注意点:
1 可以通过最近的id寻找子集绝对路径
2 注意click element和click button
3 遇到页面跳出蒙版,遮挡住选择的元素时,可以通过将屏幕最大化暂时解决
4 遇到找不到对应元素时,有时候需要sleep一段时间,等待页面元素全部加载完成。
open browser http://ct.fat4.qa.nt.ctripcorp.com/m chrome
sleep 5
click element xpath=//div[@id=‘app-ad‘]/span[1]/i[@class=‘i-close‘]
sleep 2
click element css=#bootOmit
sleep 4
input text id=account ******
input text id=password ******
sleep 2
click button id=login
sleep 5
click element css=.u-icon-flight
sleep 6
click element css=.date
sleep 5
click element xpath=//div[@id=‘div_Calendar‘]/div[3]/ul[3]/li[3]
sleep 5
click button id=btn_search
sleep 40
click element xpath=//ul[@id=‘DflightList‘]/li[1]/div[1]/div[1]
sleep 8
click button xpath=//ul[@id=‘DflightList‘]/li[1]/div[2]/div[5]/div[2]/button[@class=‘btn-book‘]
sleep 20
click element id=pg_PassengerPass_Add
sleep 20
click element xpath=//div[@id=‘ChoicePassengerList‘]/div[1]/div[1]/span[1]
sleep 2
click element xpath=//article[@id=‘pg_ChoicePassenger‘]/div[1]/span[1]/i[@class=‘u-icon-sideB nav-confirm‘]
sleep 2
click element xpath=//div[@id=‘auth_1‘]/div[@class=‘g-col-w66‘]
sleep 2
click element xpath=//ul[@id=‘SelectList‘]/li[1]/span[1]
sleep 2
click element xpath=//div[@id=‘auth_2‘]/div[@class=‘g-col-w66‘]
sleep 2
click element xpath=//ul[@id=‘SelectList‘]/li[1]/span[1]
sleep 2
click element xpath=//div[@id=‘pg_PassengerPass_List‘]/div[1]/div[1]/span[2]/span[@class=‘u-icon-deleteToggle Red fadeOut‘]
sleep 2
click element id=span_birth
sleep 2
click button id=SelectConfirm
sleep 2
click element xpath=//article[@id=‘pg_EditorPassenger‘]/div[1]/span[1]/i[@class=‘u-icon-sideB nav-confirm‘]
sleep 2
Input Text id=ContactTel1 180000000000
sleep 2
click button id=PriceBarSubmit