selenium 测试ajax的关键
1: waitForCondition(contidtion, timeout)2:selenium.browserbot.getCurrentWindow().document
下面是sample 用法
req_rsvn_01open/itr/secure/index.jspclickAndWaitlink=Request & Manage Reservations (Week at a Glance)waitForConditionselenium.browserbot.getCurrentWindow().document.forms.originIndex.options.length>110000selectoriginIndexlabel=!!Test Location Y - Test Y Town, NEwaitForConditionselenium.browserbot.getCurrentWindow().document.forms.destIndex.options.length>1||selenium.browserbot.getCurrentWindow().document.forms.destIndex.options.text!=’SelectOne’10000selectdestIndexlabel=!!Test location Z - Test Z town , NEwaitForConditionselenium.browserbot.getCurrentWindow().document.forms.eqmtIndex.options.length>1||selenium.browserbot.getCurrentWindow().document.forms.eqmtIndex.options.text!=’SelectOne’10000selecteqmtIndexlabel=ContainerclickAndWaitsubmitBtnwaitForConditionselenium.browserbot.getCurrentWindow().document.getElementById(’testCheck0′)!=null10000clickid=testCheck0waitForConditionselenium.browserbot.getCurrentWindow().document.getElementById(’id.newStandbyCount’)!=null10000typeid.newStandbyCount1keyUpid.newStandbyCountclickAndWaitrequestButton
页:
[1]