简体   繁体   English

如何使用python在机器人框架中迭代具有不同值的测试

[英]How can I iterate tests with different values in robot framework with python

I need to iterate whole test suit depending on the list passed through command line.我需要根据通过命令行传递的列表迭代整个测试套件。

Suite Setup  Data Set Up  ABC.json  ${A}  ${B}  sanity  


Default Tags  sanity


*** Variables ***
@{list}  set variable  

*** Test Cases ***

test_001_ABC_test_one

    Run ABC one

test_002_ABC_test_two

    Run ABC two

test_003_ABC_test_three

    Run ABC three

test_004_ABC_test_four

    Run ABC four

test_005_ABC_test_five

    Run ABC five

I want this 5 tests should iterate for the number of items present in the @{List} and everytime it should pass that item of the list to the test case.我希望这 5 个测试应该迭代 @{List} 中存在的项目数,并且每次都应该将列表的该项目传递给测试用例。

That looks like a case of Data Driven Test.这看起来像是数据驱动测试的一个案例。 In Robot Framework we use Templates keywords.在 Robot Framework 中,我们使用模板关键字。 See the documentation here .请参阅此处的文档。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Opera / Safari中运行Robot Framework测试? - How can I run Robot Framework tests in Opera/Safari? 如何在机器人框架测试中运行 python 文件? - How to run python file in robot framework tests? 如何在 python 中下载并保存图像机器人框架? - How can I download and save image robot framework in python? 如何在机器人框架中运行此循环? - How can I run this loops in robot framework? 带有pabot的机器人框架:是否可以在两个测试中将两个不同的值传递给变量 - robot framework with pabot : is it possible to pass two different values to a variable in two tests 机器人框架-如何使用相同的名称功能,但来自我在“关键字”部分中创建的不同python库 - robot framework - how to use the same name functions but come from different python library I created in Keywords section 如何在Robot Framework中同时调用基于Java和Python的库? - How can I call both Java- and Python-based libraries in Robot Framework? 如何使用Python中的BeautifulSoup迭代具有不同标识符的标记 - How can I iterate through tags with different identifiers with BeautifulSoup in Python 如何使用 python 比较机器人框架的数据输出 - How can i compare data output from robot framework by using python 如何在python3中迭代两个不同长度的文件 - How can I iterate two files of different length in python3
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM