|
Rank: Newbie Groups: Member
Joined: 11/20/2018 Posts: 1
|
I use chrome to log in to a website, enter document.get.ElementByid('XXX').click() in the console to simulate clicking on an input, and pop up filedialog, but execute webview1.EvalScript(document.get.ElementByid(' XXX').click()) in eo, but does not pop up filedialog, how to deal with it?thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
Hi,
No. You can not do that. The browser engine specifically block such simulation to ensure that a file dialog can only be invoked through an user action (such as clicking the browser button of a file input element). The dev console turned this check off because it's a debug tool. However EvalScript has normal JavaScript running behavior with all the security check on. So it is not possible for you to simulate this through code at runtime. Such action can only be triggered by the end user.
Thanks
|
|
Rank: Newbie Groups: Member
Joined: 2/7/2017 Posts: 1
|
wffengzheng, Did you figure out how to do this, I am using headless with a thread runner and need to Upload a file to a website. It seams that the filedialog handler never Fires, i can download files using the beforedownload and downloadcomplete handlers, how is this different?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,218
|
|
|