ddt数据驱动

数据驱动原理

1.测试数据为多个字典的list类型

2.测试类前加修饰@ddt.ddt

3.case前加修饰@ddt.data()

4.运行后用例会自动加载成三个单独的用例

5.测试结果:

Testing started at 21:51 ...
start!
{'username': 'seleniumxe7xbexa4', 'psw': '232607095'}
end!
start!
{'username': 'pythonxe7xbexa4', 'psw': '226296743'}
end!
start!
{'username': 'appiumxe7xbexa4', 'psw': '512200893'}
end!

 来源: https://blog.csdn.net/qq_39247153/article/details/81305042

上面那个今天写的时候有点问题,然后按下面这个ok

https://www.cnblogs.com/nancyzhu/p/8563884.html

原文地址:https://www.cnblogs.com/kaibindirver/p/9914649.html