2013-12-19 53 views
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> 

嗨,我怎么把一个如果,我希望它在其他循环,看看这个项目可用,如果它是移动到下一个步骤,如果不回到起点。或者它可以刷新,直到物品存在,然后移动到下一步。我m only learning so apologies if i毫无意义。硒如何循环

+0

如果需要编程逻辑考虑使用编程等替代的webdriver之一。 – MxyL

回答

0

直起Selenium IDE Documentation

Selenese的,其本身并不支持条件语句(if-else语句等)或迭代(对,同时,等)。许多有用的测试可以在没有流量控制下进行。但是,对于动态内容的功能测试,可能涉及多个页面,通常需要编程逻辑。

当需要流量控制,有三个选项:

- 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. 
+0

谢谢所有花时间回答并帮助我:-)安装了建议的扩展程序,因为它似乎是最适合我的最直接的事情。如果有人能指导我参加一个教程,也许他们已经做了类似的事情,我很乐意。我希望浏览器刷新到元素存在,然后继续。也有人知道我是否可以使用图片标签作为它需要等待的元素? – user3119786