Robot Framework基本

上一篇 / 下一篇  2017-07-11 17:06:34 / 个人分类:RF

假设我们的手工测试业务场景是这样的
[TC-001]-Launching the browser and input username and password to login the system
测试步骤:    
    Launch Browser
    Input User Info
    User Login

1.Robot Framework中的Test Data Table
Settings: 用于定义需要导入的包,相当于python中的import
Variables: 顾名思义,用于定义变量
Test Cases: 这里是定义业务场景的地方。我们的测试用例可以用即便是非技术人员也能看懂的语言来描述,比如Lauch Brower,根据名字就可以知道是打开浏览器
Keywords: 这里是真是实现我们Test Cases中所定义的行为

2.下面一步一步来完善这四个Table后

*** Settings ***
Library    Selenium2Library

*** Variables ***
${URL}https://www.google.ca
${BROWSER}CHROME
${USERNAME}admin
${PASSWORD}China123

*** Test Cases ***
[TC-001]-Launching the browser and input username and password to login the system
    Launch Browser
    Input User Info
    User Login

*** Keywords ***
Launch Browser
Open Browser${URL}${BROWSER}}
Maximize Browser Window
Input User Info
Input Textname=username${USERNAME}
Input Textname=password${PASSWORD}
User Login
Click Buttonid=btn

3.将文件保存为MyTest.rst,用robot Mytest.rst


TAG:

 

评分:0

我来说两句

Open Toolbar