0
<tr>
    <td>open</td>
    <td>http://www.theshop.com</td>
    <td></td>
</tr>
<tr>
    <td>clickAndWait</td>
    <td>css=img[alt=&quot;Theitem size 5&quot;]</td>
    <td></td>
</tr>

Hi, how do I put a if else loop in. I want it to see if this item is available if it is to move to the next step and if not to go back to the start. Or it could refresh till the item becomes present then move ont to the next step. Im only learning so apologies if im not making much sense.

1
  • If you need programming logic consider using one of the programming alternatives such as webdriver. Commented Dec 19, 2013 at 19:02

1 Answer 1

0

Straight from the Selenium IDE Documentation

Selenese, by itself, does not support condition statements (if-else, etc.) or iteration (for, while, etc.). Many useful tests can be conducted without flow control. However, for a functional test of dynamic content, possibly involving multiple pages, programming logic is often needed.

When flow control is needed, there are three options:

 - Run the script using Selenium-RC and a client library such as Java or PHP to utilize the programming language’s flow control features.
 - Run a small JavaScript snippet from within the script using the storeEval command.
 - Install the goto_sel_ide.js extension.
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks all for taking the time to answer and helping me :-) Have installed the suggested extensions as it seemed like the most straight forward thing to do for me. I would love if anyone could direct me to a tutorial maybe where they have done something similar. I want the browser to refresh till element is present then proceed once it is. Also does anyone know if i can use the image tag as the element it needs to wait for?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.