一、基础
1.通过 pip 安装扩展库 :
pip install robotframework-seleniumlibrary
2.下载谷歌游览器和对应驱动
https://www.cnblogs.com/loved-wangwei/p/8993013.html
3.将游览器驱动放在 python 的目录下
4.导入SeleniumLibrary扩展库
5.设置睡眠时间
6. 窗口最大化
7. 设置窗口位置
8. 返回上一步
9.跳转
10.刷新
二、RF 元素定位
1.selenium 中八大定位方式 :
id,name,xpath,css,link_text,partial_link_text,class_name,tag_name
前提 : 元素必须是唯一的
2.xpath
3.css
4.根据id:
5.根据name:
6.link
7.partial link
8.css
1).通过 id 进行定位: #ID
2).通过 class 定位: .class
3).通过元素属性定位: css=input[autocomplete="off"]
4).通过部分属性定位 :css=input[autocomplete*="of"]
5). 通过子元素定位 :css=div#s-top-left a:nth-child(3)