My requirement is to read examples from external excel file rather than hard code it into feature file. I have more than 100 examples which is difficult to maintain in feature file. Can you please help me on this.
Here is my scenario -
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 |
I want to create an excel file with examples data and load it during runtime
examples.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.
What you are looking for is supported using gherkin with QAF. QAF support different external data providers including json, xml, csv, excel and DB. It also supports multiple bdd syntax.
Using Gherkin or BDD2 with QAF below is the example:
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'}
There are lots of other features as well for resource management, execution configuration, driver management and parallel execution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With