Is there a way to handle the Windows File Browse with JavaScript from Selenium WebDriver (C#)? -


i'm wondering if there way handle selection of files or multiple files click open on windows file browse dialog using javascript?

the need comes during our selenium webdriver test in c# file upload. button clicked, launches windows browse.

currently have 2 mechanisms traversing dialog , both involve adding system.windows.forms reference can use sendkeys.sendwait. 1 method sends file path, sleeps second or 2 sends enter. loop through array of files using approach.

the other sends path of files, sends enter number of tabs files pane of dialog. send ctrl a, enter , grabs files in 1 lump sum.

however, both methods inconsistent. tests succeed number of time seems 'lost' during operations in browse window.

so, like, if possible, execute javascript handle file selections. know execute javascript selenium test.

i guess have handle on open window, maybe name, have select files somehow , press enter or open button. don't care if have loop through files need 1 one or multi select accomplish task.

so, first, possible. , secondly, have example of code or starting link research?

any appreciated!!


Comments