karate icon indicating copy to clipboard operation
karate copied to clipboard

Driver closes after 'call read()', but not after 'karate.call()'

Open LuuKroHY opened this issue 11 months ago • 4 comments

Using the following minimal example:

Feature: Feature showing the difference between call methods

@ignore @tocall
Scenario: Called scenario
    * driver 'https://www.google.com/'

Scenario: Using call read()
    * call read('@tocall')

Scenario: Using karate.call()
    * karate.call('@tocall')

The browser window closes automatically after the first Scenario (pass or fail), but stays open after the second, staying open even after all tests are completed. Reversing the order of the Scenario's causes the browser window to stay open after the now first Scenario, and a second browser windows opens (and closes) for the second.

Using Windows 11, Karate 1.4.0, Chrome 114.0.5735.199.

The actual issue I'm dealing with is the following: I need to call a feature from a JavaScript function. I can use karate.call() in JavaScript, but (AFAIK, I could be wrong) can't use 'call read()' in JavaScript. I added a 'quit()' to the end of the called feature, but if it fails, the browser window stays open, even after the tests are completed. Is there a solution or workaround available for this issue?

LuuKroHY avatar Jun 30 '23 09:06 LuuKroHY