*** Settings ***
Library Selenium2Library
*** Keywords ***
XXXX登录
[Documentation] 储值账号
open browser http://XXX.com/ chrome
maximize browser window
Execute Javascript a = window.document.createElement('script');a.src='//code.jquery.com/jquery-1.9.1.min.js';window.document.body.appendChild(a);
input text //*[@id="userMobile"] XXX
input text //*[@id="userPass"] 111111
Comment click element xpath=/html/body/div[1]/div/div/input
execute javascript $("input[class='SignIn']").click()
Comment click element dom=$("input[class='SignIn']")
[Teardown] sleep 10
1. 引用javascript
2. 使用jquery操作元素
3. 也可以使用jquery来定位元素,再使用selenium2library的click element来对其操作