I have to include clicking on Browse button and pick a picture from local drive. Can it be done with Selenium IDE?
Asked
Active
Viewed 1,962 times
3
-
http://stackoverflow.com/questions/8141526/how-do-you-upload-a-file-using-selenium-ide and http://stackoverflow.com/questions/9718382/script-to-upload-a-file-in-selenium-ide may help. – olyv Sep 04 '14 at 07:21
1 Answers
1
First get the id of File upload section for example (please note that in the solution I am supposing that there is a submit button whose id is Btn_Click on which click the file will get uploaded.)
<input type="file" name="abc" class="input" size="15" id="xyz"/>
Then your selenium test case would be like the below
<tr>
<td>open</td>
<td>/Your page where to upload file</td>
<td></td>
</tr>
<tr>
<td>type</td>
<td>id=xyz</td>
<td>/path of your file to be uploaded</td>
</tr>
<tr>
<td>clickAndWait</td>
<td>css=btn_click</td>
<td></td>
</tr>

Abhinav Kumar Singh
- 172
- 14