变量表中声明变量

首先我们要创建Variables表

***Variable***
${MgrloginUrl}          http://localhost/mgr/login.html
${StudentLoginUrl}      http://localhost/student/login/login.html

rf变量可以在用例里面定义,也可以在变量表里面定义

rf中的变量可以在测试套件文件中声明一个变量表。写法就是这样:Variables,对套件里的所有的测试用例都是有效的

*** Settings ***

*** Variables ***
${MgrloginUrl}          http://localhost/mgr/login.html
${StudentLoginUrl}      http://localhost/student/login/login.html

*** Test Cases ***
case1
    log to console     ${MgrloginUrl}
    log to console     ${StudentLoginUrl}
case2
    log to console     ${MgrloginUrl}
    log to console     ${StudentLoginUrl}

定义好了之后,只要改变变量就行

rf支持4种类型的表
Settings表:配置表;
Test Case:用例表;
Keywords:关键字表;