Attempting to execute a click on an element
Posted: Tue Jan 16, 2024 9:32 pm
Greetings Salvadordf,
I need to click the "#Filename" object, but the following does not work.
If I go to the console, I can insert the following line and it executes correctly.
Am I missing something?
Something that worked before where I would simulate a mouse click on a "Choose File" button, no longer is working.
The message in the console shows: about:blank:1 File chooser dialog can only be shown with a user activation.
If executing "document.querySelector("#Filename").click()" in the console works, there must be a way to get this to work, right?
As a last resort, is there any way to stuff that command in the console window and execute it in the background?
Thanks for any ideas,
Mike
I need to click the "#Filename" object, but the following does not work.
Code: Select all
Chromium1.browser.MainFrame.ExecuteJavaScript('document.querySelector("#Filename").click()', 'about:blank', 0);
Code: Select all
document.querySelector("#Filename").click()
Something that worked before where I would simulate a mouse click on a "Choose File" button, no longer is working.
The message in the console shows: about:blank:1 File chooser dialog can only be shown with a user activation.
If executing "document.querySelector("#Filename").click()" in the console works, there must be a way to get this to work, right?
As a last resort, is there any way to stuff that command in the console window and execute it in the background?
Thanks for any ideas,
Mike