Upload photo using autoIT not working. | Selenium Forum
M
Posted on 09/02/2017
[b:26y729vi]step1.[/b:26y729vi]

temp.au3

$windowHandle = WinGetHandle("File Upload")
WinActivate($windowHandle)
ControlSetText("File Upload", "", "[ClassnameNN :Edit1; INSTANCE:1]", "E:\upload.jpg")
ControlClick("File Upload", "","[CLASS:Button; INSTANCE:1]")


[b:26y729vi]step2.[/b:26y729vi]

save and compile

[b:26y729vi]step 3.[/b:26y729vi]


save .exe file on project folder

driver =new FirefoxDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
driver.get("http://qtpselenium.com/test/uploadform/contactform.php");


driver.findElement(By.xpath("//*[@id='photo']")).click();

Process process =new ProcessBuilder(System.getProperty("user.dir")+"\\src\\uploading\\temp.exe","","Open").start();


[b:26y729vi]
[i[u:26y729vi]]Result : Photo doesn't uploaded[/i][/u:26y729vi]
[/b:26y729vi]

M
Replied on 09/02/2017

send a screen shot of the error.


M
Replied on 10/02/2017

Hello,

1. There is no error/exception on console screen ..but code does not works for file upload.

2. Code execution get terminated after 'click' on browse button.

3. Screenshots are attached for 1.console screen, 2. autoit code file. 3. complete package folder are attached.


M
Replied on 10/02/2017

It's working ... photo uploaded no problem... i rewinded video followed step by step.