1

I am working on UI automated tests using Karate framework. I am really enjoyng working with this great tool, but it's something that I'm trying to resolve for a while and can't find any solution.

I have a feature file with 3 scenarios and I want to open the browser and to make login only once, before all scenarios, and to be closed only after the last scenario is finished. In my case driver is started at separated login.feature file which is called from Background using 'callonce read('login.feature')' command. I've seen somewhere that if driver is started before scenario. In my case it's not working. What do I do wrong?

Boris Frenkel
  • 324
  • 3
  • 11

1 Answers1

1

You can use this answer as a reference: https://stackoverflow.com/a/60581024/143475

So it is supposed to work if you create a feature and then call the other scenarios from that feature. Karate is designed to close the driver after a Scenario by default.

I also recommend that when you have a flow, don't try to split it into different Scenarios. Or you should be prepared to call different features from one Scenario.

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248