How to upload file ( picture ) with selenium, python

0
0

is there any possibility how to upload on web picture with selenium testing tool ? I am using python.

I tryed many things, but nothing didnt work. I am desperate.

Upload looks like this :

http://img21.imageshack.us/img21/1954/uploadgr.jpg

Thank you for your help

Filip.

  • You must to post comments
0
0

Upload input control opens a native dialog (it is done by browser) so clicking on the control or browse button via Selenium will just pop the dialog and the test will hang.

The workaround is to set the value of the upload input via JavaScript (in Java it is done via JavascriptExecutor) and then submit the form.

See this question for sample in C#, I am sure there’s also a way to call JavaScript in Python but I never used Selenium Python bindings

  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website