Unable to locate the 'File Upload' window to proceed with file upload using Python 3.4/Selenium web driver in windows10

65 views
Skip to first unread message

Ranjana Palanivel

unread,
May 16, 2018, 9:51:42 PM5/16/18
to seleniu...@googlegroups.com

Hi All,

I am unable to locate the 'File Upload' window while writing automation script for web page to upload the file.

I have tried with these two different scripts to achieve this:But 'Unable to locate 'File Upload' /'fileUploadID' exception is thrown.

PFA the screenshot for further details.
Please help me out on this.
(a)
driver.find_element_by_xpath('//img[@src="/img/white_upload.png"]').click()  #Upon clicking this image ,File upload window opens
wait = WebDriverWait(driver, 10)
wait.until(EC.new_window_is_opened)
driver.switch_to.window("File Upload")
element=driver.find_element_by_name("File name")
element.send_keys("C:\\Users\\ranjana.palanivel\\Aaj Jane Ki Zid Na Karo.mp3")
(b)
driver.find_element_by_xpath('//img[@src="/img/white_upload.png"]').click()  #Upon clicking this image ,File upload window opens
wait = WebDriverWait(driver, 10)
wait.until(EC.new_window_is_opened)
filepath=driver.find_element_by_id("fileUploadId")
filepath.send_keys("C:\\Users\\ranjana.palanivel\\Aaj Jane Ki Zid Na Karo.mp3")
Thanks & Regards
Ranjana P
fileupload.png
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Ripon Al Wasim

unread,
May 11, 2020, 1:07:41 PM5/11/20
to seleniu...@googlegroups.com
Hi Ranjana Palanivel,

Selenium itself does not handle native window/pop up. It needs to integrate other tool to handle File upload window.

You can integrate the followings:
Sikuli
AutoIt

If you use java with Selenium you can use java Robot class.

For handling Save window, same tool(s) could be used.

br,
Ripon Al Wasim

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANS_8%3DvJcZK%2BzZORVb9zdFHW62%2BnovF-timzV-jEZfO%3DPCtvFQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages