Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Robotframework 向Robot数据驱动测试用例添加无关步骤_Robotframework_Data Driven Tests - Fatal编程技术网

Robotframework 向Robot数据驱动测试用例添加无关步骤

Robotframework 向Robot数据驱动测试用例添加无关步骤,robotframework,data-driven-tests,Robotframework,Data Driven Tests,考虑以下数据驱动的测试用例: TC001_Sign_in_test [Documentation] testing sign in with various credentials. [Teardown] ${None} [Template] attempt sign in and check status ${corr_usrnm} ${corr_pswd} ${welcome_screeen

考虑以下数据驱动的测试用例:

TC001_Sign_in_test
    [Documentation]     testing sign in with various credentials.
    [Teardown]          ${None}
    [Template]          attempt sign in and check status
    ${corr_usrnm}       ${corr_pswd}        ${welcome_screeen}
    ${corr_usrnm}       ${mispld_pswd}      ${sign_in_error_label}
    ${corr_usrnm}       ${EMPTY}            ${sign_in_error_label}
    ${EMPTY}            ${corr_pswd}        ${sign_in_error_label}
    ${mispld_usrnm}     ${corr_pswd}        ${sign_in_error_label}
在测试的第一步中,我们使用正确的用户名和密码登录后,我的应用程序已经登录,我想注销,以便我可以执行下一个错误的密码步骤

我想知道是否可以在正确密码和错误密码步骤之间插入注销步骤。我不必这样做,我可以将成功的步骤放在最后,轻松解决问题,或者只是为成功登录创建另一个单独的测试,但我想知道是否有可能在数据表的两行之间插入操作。

只需将注销步骤添加到模板关键字,
尝试登录并检查状态
。如果这是从库中导入的关键字,由于某种原因无法修改,则始终可以创建一个包装器用户关键字来调用此关键字,然后调用注销所需的关键字


当然,由于并非所有测试都能成功登录,您可能需要根据传递给模板关键字的预期状态设置条件。

这是一种很好的方法,我以前没有考虑过。但这是否意味着无法通过使用某种转义字符在数据表中添加过程步骤?