安装
打开网页
点击元素
将元素内容赋给变量
判断变量是否正确。
*** Settings ***
Library Selenium2Library
*** Test Cases ***
host_healthy
Open Browser https://192.168.123.170/#/dashboard
Click element xpath=//div[@id='app']/div/nav/div[6]/div/div/span
${text} Get Text xpath=//*[@id="app"]/div[1]/div/div[2]/div[2]/div[2]/table/tbody/tr[1]/td[5]/div[1]/div/span
Sleep 2s
Should Contain ${text} 健康
Close Browser
Q&A
1.Q: 提示from robot.variables import GLOBAL_VARIABLES
A: 在目录/Library/Python/2.7/site-packages/robot/variables里面添加空文件:GLOBAL_VARIABLES.py
网友评论