File Upload window is not maximized | Selenium Forum
M
Posted on 24/02/2016
Hi Ashish,

As you explained in Video4 of Module 15 we can use AutoIt tool to upload file from local drives of our desktop.To do this I have installed AutoIt tool and wrote code and "exe" file is generated at my desktop.But when I am clicking on the generated "exe" file "File Upload" window is not getting maximize. I have tried hard but stuck.Can you please tell me where I am wrong and suggest me the way to resolution of the same.Kindly refer attached screenshot for your reference.
Thanks a lot in advance.

M
Replied on 24/02/2016

https://www.autoitscript.com/autoit3/docs/functions/WinSetState.htm


M
Replied on 27/02/2016

Thanks Its working fine now by using test.exe file file is uploaded.But when I use this test.exe my selenium code its not working.The Upload File window is maximizing but file is not getting select.I think "Process process = new ProcessBuilder(System.getProperty("user.dir")+"\\src\\FileUpload\\test.exe", "", "Open").start()" code is not working.Correct me if I am wrong.
@Ashish.Can you please tell me where is the problem and resolution of the same.For your reference,I have attached all the screenshots of all process I have followed to do the same as you explained in 15.4 video.

Thanks in advance.


M
Replied on 29/02/2016

Hi Ashish,

Now I got it why it was not working actually I was clicking on second browse button(to upload resume) and I have wrote code for simply upload file from ""File Upload" window and I think by default AutoIt tool taking files from first "File Upload" window which comes after clicking on first browse button(to upload photo). When I am clicking on first button(to upload photo ) the code is working as expected. But I want to know what should I do for uploading resume (from second browse button) from selenium code because here both windows have same title "File Upload"(displays after clicking on first browse button or second browse button). I think I have to give specific identification of "File Upload " window in my AutoIt script but I am not sure and if I will have to give specific identification of "File Upload " window how can I write in AutoIt script.Can you please help me on the same.

Thanks in advance.


M
Replied on 01/03/2016

what is the question.


M
Replied on 01/03/2016

By using AutoIt tool, I want to upload file "new 1.txt" from second browse button available(to upload resume) on "http://qtpselenium.com/test/uploadform/contactform.php" webpage. But I am unable to do the same because after clicking both browse buttons available on mentioned webpage windows displaying is of same names "File Upload". So my question is where I need to do change in AutoIt script. As explained by Ashish we can calculate ids of different pop up windows.On similar note, I want to know is there any way to know ids of "File Upload" windows using "AutoIt Finder Tool" so that we can give proper identification of "File Upload" Windows.Kindly refer attached snapshot for your convenience.

Note:-1. Here I am uploading "new 1.txt" file.
2.For first browse button(to upload photo) code is working as expected.


M
Replied on 03/03/2016

you have to make 2 script of auto it. one for each "choose file."


M
Replied on 03/03/2016

Okay, got it.The same AutoIt script(exe file) is working fine when I run it simply by clicking on it.But when I am using the same exe file from selenium code the files not getting upload.Just File Upload window maximizing but file not selected and not clicked on open button.can you please tell me where I am wrong and help me on the same.


M
Replied on 03/03/2016

one was about file upload other was about image upload so 2 different auto it codes have to be written to get the 2 different files.