zoukankan      html  css  js  c++  java
  • robotframework

    1、添加新建好的资源

     2、测试用例原始代码如下(未做任何分离的数据)

    *** Settings ***
    Library SeleniumLibrary
    Resource UI分层一.txt
    Resource UI分层二.txt

    *** Test Cases ***
    测试用例原始代码
    Open Browser https://www.baidu.com firefox
    Input Text id = kw selenium
    Click Button id = su
    Wait Until Page Contains Element css = #su
    sleep 2
    ${title} get title
    Should Contain ${title} selenium_百度搜索
    Close Browser

    3、调用 UI分层一

    *** Settings ***
    Library SeleniumLibrary

    *** Keywords ***
    打开浏览器
    [Arguments] ${url} ${webdriver}
    Open Browser ${url} ${webdriver}

    输入框
    [Arguments] ${search}
    Input Text id = kw ${search}

    点击百度搜索按钮
    Click Button id = su

    等待时间
    sleep 2

    验证标题
    [Arguments] ${result}
    ${title} get title
    Should Contain ${title} ${result}

    关闭浏览器
    Close Browser

    4、调用 UI 分层二

    *** Settings ***
    Library SeleniumLibrary
    Resource UI分层一.txt

    *** Keywords ***
    验证百度搜索
    [Arguments] ${url} ${driver} ${input} ${text}
    打开浏览器 ${url} ${driver}
    输入框 ${input}
    点击百度搜索按钮
    等待时间
    验证标题 ${text}
    关闭浏览器

     

  • 相关阅读:
    坐标系的冷知识2
    坐标系的冷知识
    XMPP即时通讯(代码实现)
    约束问题
    实现ios屏幕的横竖屏自适应
    3D Touch ? 木有6s,也阔以玩!!!
    Autolayout
    Xcode7免证书真机调试
    微信支付
    二维码扫描
  • 原文地址:https://www.cnblogs.com/Teachertao/p/11892770.html
Copyright © 2011-2022 走看看