美文网首页
robot framework

robot framework

作者: heliping_peter | 来源:发表于2018-02-02 15:53 被阅读6次

安装

打开网页
点击元素
将元素内容赋给变量
判断变量是否正确。

*** 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

相关文章

网友评论

      本文标题:robot framework

      本文链接:https://www.haomeiwen.com/subject/dqdezxtx.html