20200616基本JS指令

innerHTML 查看text文本
. 查看标签属性
setAttribute 设置元素属性
removeAttribute 移除元素属性
scrollingElement.scrollTo 左右滑动
scrollingElement.scrollTop 上下滑动
argument[0],scrollIntoView(),element 精准滑动到指定元素

获取文本需在js前添加return

switch_to_alert()--定位弹出对话框
text()--获取对话框文本值
accept()--相当于点击“确认”
dismiss()--相当于点击“取消”
send_keys()--输入值(alert和confirm没有输入对话框,所以就不用能用了,只能使用在prompt里)

原文地址:https://www.cnblogs.com/Murraya/p/14099539.html