Conditional check in Selenium IDE

陌路散爱 提交于 2019-12-10 09:49:05

问题


I want to check whether a possibly mandatory field is filled in using selenium. I would very much prefer to do this using the IDE rather than exporting to code.

To be more specific, I want to make sure that a post code field is filled in if the value of the country drop down list is 'United Kingdom'. The post code field can be left blank if the drop down list is set to anything else.

If the consensus is that I have to export and do the test in code, then I will, but I would be a lot happier if I could sort this out just through the IDE.


回答1:


Unfortunately, Selenium-IDE does not offer any flow control functionality by default. However, the Flow Control plugin introduces a few new commands - while, gotoIf, label and the ...andWait variants. Using these, you should be able to check the currently selected value in the dropdown menu, and jump past a verify command if the value is not "United Kingdom".

Fair warning; it's not the easiest thing in the world to work with. For anything beyond very basic flow control, you'd probably be better off exporting to code anyway. But, it's an option for when you really want to push the IDE!



来源:https://stackoverflow.com/questions/22377980/conditional-check-in-selenium-ide

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!