selenium 測試ajax的關鍵

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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章