1: waitForCondition(contidtion, timeout)
2:selenium.browserbot.getCurrentWindow().document
下面是sample 用法
| req_rsvn_01 | ||
| open | /itr/secure/index.jsp | |
| clickAndWait | link=Request & Manage Reservations (Week at a Glance) | |
| waitForCondition | selenium.browserbot.getCurrentWindow().document.forms[0].originIndex.options.length>1 | 10000 |
| select | originIndex | label=!!Test Location Y - Test Y Town, NE |
| waitForCondition | selenium.browserbot.getCurrentWindow().document.forms[0].destIndex.options.length>1||selenium.browserbot.getCurrentWindow().document.forms[0].destIndex.options[0].text!=’Select One’ | 10000 |
| select | destIndex | label=!!Test location Z - Test Z town , NE |
| waitForCondition | selenium.browserbot.getCurrentWindow().document.forms[0].eqmtIndex.options.length>1||selenium.browserbot.getCurrentWindow().document.forms[0].eqmtIndex.options[0].text!=’Select One’ | 10000 |
| select | eqmtIndex | label=Container |
| clickAndWait | submitBtn | |
| waitForCondition | selenium.browserbot.getCurrentWindow().document.getElementById(’testCheck0′)!=null | 10000 |
| click | id=testCheck0 | |
| waitForCondition | selenium.browserbot.getCurrentWindow().document.getElementById(’id[0].newStandbyCount’)!=null | 10000 |
| type | id[0].newStandbyCount | 1 |
| keyUp | id[0].newStandbyCount | |
| clickAndWait | requestButton | |
本文展示了一个使用Selenium进行自动化测试的示例流程。包括打开网页、点击元素、选择下拉菜单选项、填写表单并提交等操作,以及如何等待特定条件成立。
448

被折叠的 条评论
为什么被折叠?



