我的要求是从外部 Excel 文件读取示例,而不是将其硬编码到功能文件中。我有 100 多个示例,这些示例很难在功能文件中维护。你能帮我解决这个问题吗?
这是我的场景 -
Scenario Outline: Browser Test
When I visit the URL <base>/<page>/<ordNumber>/<custName>
Then the browser contains test <custNumber>
Examples:
| base | page | ordNumber | custName |
| http://www.stackoverflow.com | orders | 123 | John |
| http://www.stackoverflow.com | orders | 456 | Mike |
| http://www.stackoverflow.com | orders | 789 | Tom |
我想创建一个包含示例数据的 Excel 文件并在运行时加载它
示例.xls
| base | page | ordNumber | custName |
| http://www.stackoverflow.com | orders | 123 | John |
| http://www.stackoverflow.com | orders | 456 | Mike |
| http://www.stackoverflow.com | orders | 789 | Tom |
Thanks.
使用支持您正在寻找的内容小黄瓜与 QAF。 QAF支持不同的外部数据提供者包括 json、xml、csv、excel 和 DB。它还支持多重 bdd 语法.
下面是使用 Gherkin 或 BDD2 与 QAF 的示例:
Scenario Outline: Browser Test
When I visit the URL <base>/<page>/<ordNumber>/<custName>
Then the browser contains test <custNumber>
Examples: {'datafile': 'resources/testdata/examples.xls'}
还有许多其他功能用于资源管理、执行配置、驱动程序管理和并行执行。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)