我的机器人框架工作套件设置__init __。机器人不运行

时间:2017-05-12 01:03:24

标签: robotframework

我有这个设置

__ INIT __机器人:

*** Settings *** Suite Setup    Init
*** Keywords ***
Init
    Log  Initialization   console= true`

test.robot:

*** Test Cases ***
Case1
Log  test case 1   console=true 

suite.txt:

test.robot

我跑的时候 pybot --argumentfile suite.txt

我的__init __。机器人无法运行。 我如何让它运行?

1 个答案:

答案 0 :(得分:3)

机器人在使用__init __。机器人执行文件夹内的一个文件时不执行__init __。机器人。

请考虑您的文件位于/ TestSuite /下,运行以下内容以查看更改:

pybot /TestSuite  (this will execute everything inside TestSuite with __init__ )

pybot -s test -t Case1 /TestSuite (this will execute suite test.robot and only selected test Case1 from folder TestSuite together with __init__ )

pybot -t Case1 /TestSuite/test.robot (this will execute only Case1 from test.robot without __init__ )

RobotFramework救援文件: http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#execution-flow

相关问题