File Upload using Selenium WebDriver and Java Robot Class

后端 未结 7 1863
说谎
说谎 2020-11-28 07:19

I am using Selenium WebDriver and Java and I need to automate the file upload feature. I tried a lot, but the moment the Browse button is clicked and a new window opens the

7条回答
  •  星月不相逢
    2020-11-28 07:43

    The moment after the modal dialog opens the script will not work, it just hangs. So call autoit.exe first and then click to open the modal dialog.

    It works fine like this,

     Runtime.getRuntime().exec("Upload_IE.exe");
     selenium.click("//input[@name='filecontent']");
    

提交回复
热议问题