- Settings里面包括:所用的库Library (Selenium2Library)、Test.Setup(Open.Browser..........具体地址........所用的浏览器(Chrome))
- Test.Teardown(Close Browser)
- Test.Case里面包括:案例名称(验证是否登录成功)、Input.Text(用户名输入框的id或name......具体的用户名)、Input.Password(密码输入框的id或name.......具体的密码)、Click.Element(登陆按钮的id或name或Xpath)
- 还用到了:Title.Should.Be、Page.Should.Contain、Wait Until Element Is Visible
- Wait Until Element Is Visible.............(locator,timeout ),一定要用这个,用在Page.Should.Contain之前,因为打开平台是需要很短的时间的,在这个很短的时间中要监测定位元素。
- locator:包括id、name、XPath、CCS。
id:example
name:example
tag:div
xpath=//div[@id:"example"]
- 元素定位方法:浏览器右上角(更多意思的按钮)—>工具—>开发者工具