-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Driver closes after 'call read()', but not after 'karate.call()' #2351
Comments
@LuuKro can you do this quick test Scenario: Using karate.call()
* karate.call(true, '@tocall') So the let me know if that works and the docs may need to be updated and maybe we need to fix this issue you reported. so yes, the whole browser / driver mechanism in karate is designed to work only in "shared scope". |
I tried it, and it mostly solved the issue! However, if the called scenario fails, the 'call read()'-Scenario fails instantly, while the 'karate.call()'-Scenario stays open for 30 seconds. This can be easily replicated by modifying the first Scenario above as such:
Looking at the logs, it seems like it has something to do with Chrome's screenshot-functionality failing in the second Scenario:
I'm afraid my technical knowledge about this is too limited to do an actual Root Cause Analysis, but I hope this helps. Concerning changing the docs, it might be an idea to expand the 'call vs read()'-header to 'call vs read() vs karate.call()'? In any case, thanks for the help! Having the tests take a little longer if one of them fails is a lot less cumbersome than ending a testset with 20 Chrome windows open 😄 |
@LuuKro thanks for the details. are you on Karate 1.4.0 because I thought we tried to make that screenshot part a little better. but we will look into this particular issue for sure |
@LuuKro nevermind, just noticed you mentioned you are on 1.4.0 |
Using the following minimal example:
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?
The text was updated successfully, but these errors were encountered: