Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to attach pictures using Selenium IDE?

I have to include clicking on Browse button and pick a picture from local drive. Can it be done with Selenium IDE?

like image 674
AleMaxX Avatar asked Dec 04 '25 20:12

AleMaxX


1 Answers

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>
like image 152
Abhinav Kumar Singh Avatar answered Dec 07 '25 10:12

Abhinav Kumar Singh