当前位置:网站首页>Pytest data parameterization & data driven
Pytest data parameterization & data driven
2022-06-22 06:26:00 【Think twice】
Parameterization uses :
@pytest.mark.parametrize(argnames,argvalues)
argnames: Variables to parameterize ,string( Comma separated ),list,tuple
argvalues: Parameterized values ,list,list[tuple]
Use string:@pytest.mark.parametrize(‘a,b’,[(10,20),(30,40)])
Use list:@pytest.mark.parametrize([‘a’,‘b’],[(10,20),(30,40)])
Use tuple:@pytest.mark.parametrize((‘a’,‘b’),[(10,20),(30,40)])
Use yaml Data parameterization :
yaml Realization list:
list
- 10
- 20
- 30
yaml Implement Dictionary :
dict
by:id
locator:name
action:click
yaml Nesting :
-
- by:id
- locator:name
- action:click
load yaml file :yaml.safe_load(open(“./test.yaml”))
Data driven
brief introduction
Data driven is the change of data, which drives the execution of automatic test , Finally, it causes the test results to change . Simply speaking , It's the application of parameterization . Test cases with small amount of data can use code parameterization to realize data-driven , In case of large amount of data, it is recommended to use a structured file ( for example yaml,json) To store data , Then read the data in the test case .
Application scenarios
App、web、 Interface automation testing
1. Data driven test steps
2. Data driven test data
3. Configured data driver
边栏推荐
- R language observation log (part24) -- writexl package
- Subqueries in sqlserver
- WPS文档目录更新产生的问题记录
- Idea run scope locally
- [5g NR] ng interface
- 5g terminal identification Supi, suci and IMSI analysis
- SQL injection vulnerability (XI) wide byte injection
- 【5G NR】NGAP协议之NG Setup
- Performance comparison and analysis
- Overview of coherent sonar Geoswath
猜你喜欢

Subqueries in sqlserver

Seven parameters of thread pool and custom thread pool

四大函数式接口(必需掌握)

Expert system clips from introduction to mastery (I) introduction and overview of clips

Configuration files required for SSM integration and error reports caused by common configuration errors

Callable

Reflection operation annotation

Shengxin visualization (Part2) -- box diagram

集合类并发不安全问题

Producer and consumer issues
随机推荐
C skill tree evaluation - customer first, making excellent products
Unsafe concurrency of collection classes
[openairinterface5g] ITTI messaging mechanism
R language observation log (part24) -- writexl package
反射操作注解
leetcode每周3道(八)图之最短路
[PHP]TP6 CLI模式下创建tp6和多应用配置以及常见问题
仙人掌之歌——上线运营(5)
What is JUC
tp6链接sqlserver,php链接sqlserver,linux离线安装与部署超详细
Use of stopwatch
【5G NR】NGAP协议之NG Setup
5G-GUTI详解
SQL injection vulnerability (XI) wide byte injection
W800 chip platform enters openharmony backbone
Reflection operation annotation
性能对比分析
ReadWriteLock
Usage of trim, ltrim and rtrim functions of Oracle
什么是JUC