File Upload Feature using Selenium and java -
i need automate file upload feature in web console , using selenium , java this. tried multiple approaches when click on upload button , windows explorer gets opened, stops there. doesn't select file...and gives error there no file.. tried in firefox , chrome both not able solve problem.
then tried autoit tool. downloaded , made script. trying compile script getting error:
code i'm using:
webdriver driver = new firefoxdriver(); driver.get("localhost:8080/page"); webelement selectuploadapk = driver.findelement(by.id("id of upload button")); selectuploadapk.click(); webelement file = driver.findelement(by.xpath("//input[@type='file']")); file .sendkeys("path of file"); error: unable execute upx.exe compress stub file file not found exception
please help
thanx in advance
megha
you don't need click on field open dialogue box.
opening dialogue box 'breaking' test.
just send keys directly input element, are, , click on ever button 'upload' button.
driver.findelement(by.xpath("//input[@type='file']")).sendkeys("/path/to/file"); driver.findelement(by.id("id of upload button")).click();
Comments
Post a Comment