Robot Framework Tutorial
- Robot Framework - Discussion
- Robot Framework - Useful Resources
- Robot Framework - Quick Guide
- Testing Login Page Using Robot Framework
- Working With External Database libraries
- Working with Built-In Library
- Working With Setup And Teardown
- Working With Command Line
- Working With Variables
- Working With Keywords
- Working With Dropdown
- Working With Checkbox
- Working With Radio Button
- Working With Textbox
- Working With Browsers Using Selenium Library
- Keyword and Data Driven Test Cases
- Writing and Executing Test Cases
- First Test Case Using Ride
- Introduction to Ride
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Keyword and Data Driven Test Cases
试验场的工作流程可以使用关键词或数据驱动风格进行测试。 如果你想用不同的投入来测试工作流程,那么也可以使用数据驱动的测试案例。 我们将努力树立一个榜样,采用以下试验案例方法:
Keyword Driven style
Data Driven style
Keyword Driven Style
我们将开展一个项目,展示由关键词驱动的工作。
公开使用ride 从指挥线出发。
![Keyword Driven Style](/robot_framework/images/keyword_driven_style.jpg)
Cpck on New Project and given a name to their project.
![Keyword Driven Style Ex](/robot_framework/images/keyword_driven_style_ex.jpg)
该项目的名称是关键词。 Cpck OK,以拯救该项目。 在此项目中,我们将形成一个用户关键词,如下文所示。
Right-cpck on the name of the Project and Point on Newuser Keyword , as psted below
![New User Keyword](/robot_framework/images/new_user_keyword.jpg)
播放下列屏幕:
![display screen Ex](/robot_framework/images/display_screen_ex.jpg)
采用关键词的名称及其论点。 在此,我们将以显示电文为关键词名。 关键词显示电文的作用是,在发出电文时,电文将出现信号。 因此,我们需要对此提出论据。 因此,在上述例子中,这一论点将是一个小数变量,即“imsg}”。
![log message](/robot_framework/images/log_message.jpg)
Cpck OK,以节省用户关键词。 我们现在需要撰写行动关键词。 因此,它将有如下表格格式:我们可以向图书馆提供关键词,或用机器人框架提供内在关键词。
在这里,我们将使用一个具备机器人框架的简单记录关键词——如下所示:
![log keyword Ex](/robot_framework/images/log_keyword_ex.jpg)
a. 在下表一栏中获取机器人框架、新闻剪辑+空间条码的更关键词:
![table column](/robot_framework/images/table_column.jpg)
因此,我们想要用我们的试验方法使用的关键词已经准备好。 用户关键词名称为Display 信,其中有一个论点称为${msg}。
我们现在在简单关键词驱动的风格测试个案中使用这一关键词。 为此,我们需要制造试验案例。 项目名称上的右翼浮标。 现在,点击新试验案——
![keyword driven](/robot_framework/images/keyword_driven.jpg)
![simple keyword](/robot_framework/images/simple_keyword.jpg)
Give name to the test case and Point OK.
我们在项目设置过程中,现在将撰写关键词驱动风格的测试案例。
在测试案例中,我们使用了以下表格格式的用户定义关键词显示电文:
![user defined keyword Ex](/robot_framework/images/user_defined_keyword_ex.jpg)
我们使用了上文所阐明的关键词,并通过了Hello世界的价值。
我们将执行试验案TC1,并检查产出——
![execute test case Ex](/robot_framework/images/execute_test_case_ex.jpg)
在上述例子中,我们撰写了一个简单的测试案例,记录电文,测试案例以产出Hello World执行。 我们可以看到该日志中印制的Hello世界产出。 测试案例也在此通过。
Data Driven Style
我们将在同一项目中另立一个试验案例。 我们将把试验场的名称定为TC2。
![more test case](/robot_framework/images/more_test_case.jpg)
为了配合数据驱动风格,我们需要建立模板。 模板将采用高档关键词的名称,这是像我们在“显示器”一开始创建的用户界定的关键词。 向该模板提出的论点将以测试案例的形式发出。 我们可以把不同的价值观传给这一模板的关键词。 在你希望用不同数据对假设情景进行测试时,数据驱动的方法多数使用。
试办案一旦获救。 试样和显示如下:
![data driven style](/robot_framework/images/data_driven_style.jpg)
Cpck on Edit button for Template and Add theuser-fin keyword.
![Edit button](/robot_framework/images/edit_button.jpg)
输入模板的用户关键词,并点击K,以节省模板。
![user keyword](/robot_framework/images/user_keyword.jpg)
Display 信关键词有一个称为“{msg}”的论点。 这是一个小数变量。 测试案件中通过的细节将作为向用户确定的关键词显示电文提出的论点。
![keyword Display Message](/robot_framework/images/keyword_display_message.jpg)
在TC2中,我们增加了“模板显示”信息(用户界定的关键词)。 我们以表格形式发出信息。
现在,让我们执行试验。
![Template Display Message](/robot_framework/images/template_display_message.jpg)
我们可以看看看Run 两处试验案例。 技术合作1的产出为Hello World。 这是我们向用户关键词显示电文发出的信息。
就TC2而言,我们利用显示电文作为模板。 我们通过My First Test Case和《试验<>/i>作为TC2的数值。 由于用户关键词显示电文使用内部记录关键词,因此如上所示,在记录中显示电文。
Conclusion
我们在本章中使用了关键词风格和数据风格,并看到两者的工作。 数据驱动风格将高层次用户定义的关键词作为模板,所有测试案例都作为模板的数值。
Advertisements