I'm new to gotoif condition in SeleniumIDE. Trying to use it to test this scenario in the same test:
- If page displays "test" icon, then click Launch and skip next step.
- If page doesn't display "test" icon, then proceed to next step.
I'm new to gotoif condition in SeleniumIDE. Trying to use it to test this scenario in the same test:
If You allways have pictire (but diffrent) in this place, You can get Xpath and get scr atribue of this picture:
<tr>
<td>storeAttribute</td>
<td>//body/div/img@src</td>
<td>urladress</td>
</tr>
<tr>
<td>gotoIf</td>
<td>'${urladress}'!= 'http://mypage.com/img/test.ico'</td>
<td>marker1</td>
</tr>
<tr>
<td>echo</td>
<td>Here commands for this picture</td>
<td></td>
</tr>
<tr>
<td>label</td>
<td>marker1</td>
<td></td>
</tr>
<tr>
<td>gotoIf</td>
<td>'${urladress}'== 'http://mypage.com/img/test.ico'</td>
<td>marker2</td>
</tr>
<tr>
<td>echo</td>
<td>Here commands without this picture</td>
<td></td>
</tr>
<tr>
<td>label</td>
<td>marker2</td>
<td></td>
</tr>
If it do not work you can use javascript function:
<tr>
<td>storeBodyText</td>
<td>body</td>
<td></td>
</tr>
<tr>
<td>storeEval</td>
<td>javascript{storedVars['body'].search('test.ico')}</td>
<td>result</td>
</tr>
<tr>
<td>gotoIf</td>
<td>${result}==-1</td>
<td>marker1</td>
</tr>
<tr>
<td>echo</td>
<td>Here commands for this picture</td>
<td></td>
</tr>
<tr>
<td>label</td>
<td>marker1</td>
<td></td>
</tr>
<tr>
<td>gotoIf</td>
<td>${result}!=-1</td>
<td>marker2</td>
</tr>
<tr>
<td>echo</td>
<td>Here commands without this picture</td>
<td></td>
</tr>
<tr>
<td>label</td>
<td>marker2</td>
<td></td>
</tr>