1

Can we call a feature file in a scenario outline? I have a test case where my Create Record scenario outline have some filtered CSV data in it's examples section, but to create record in the page you need to login first. If I call login feature file from Create Record scenario outline.

Login feature file run for multiple data set. Like if Create Record have 2 data set then Login is creating another 2 set of data for the main 2 set of data. So login feature file running for 6 test data.

Is there any better approach to this problem with Karate UI automation?

Below is my feature file structure Create Record feature file:

Scenario Outline: Create record for filtered data from CSV
    * call read('commonFeatures/login.feature')
    * create record steps

Examples:
| filtered data |

The data will fed to login feature file. Login feature file:

Scenario Outline: Login for filtered data from CSV
    * User Login steps

Examples:
| filtered data |

I know there is some flaws with my approach as I am using the same data for both feature file. But I require the same data like user A need to create record then User A need to login First.

ex-ninja
  • 59
  • 2
  • if the linked answer (and links from there) don't answer your question, assume it is not supported by karate – Peter Thomas Dec 21 '20 at 16:52
  • Hi @Peter Thomas, thanks for the response. We went through those links but it's more regarding feature file reusability having Examples keyword. Our requirement is one feature file will take filtered CSV data and call the second feature file again which will use the same data. Are we right with the expectations from karate or beyond, please help. – ex-ninja Dec 22 '20 at 07:06
  • nope, look for another tool or contribute code – Peter Thomas Dec 22 '20 at 08:11

0 Answers0