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}
    关闭浏览器

     

  • 相关阅读:
    2017年9月22日 关于JS数组
    2017年9月20日
    2017年9月19日 JavaScript语法操作
    2017年9月18日
    2017年9月17日 JavaScript简介
    2017年9月16日
    2017年9月15日
    2017年9月14日
    2017年9月12日
    贪吃蛇全文
  • 原文地址:https://www.cnblogs.com/Teachertao/p/11892770.html
Copyright © 2011-2022 走看看