UI tests fail to communicate with chrome after receiving `Target.detachedFromTarget` event
See original GitHub issueIssue
We’re seeing some unexpected errors during our tests like:
18:32:36.707 [main] WARN c.i.k.driver.chrome_1647127935267 - waitUntil evaluate failed: failed to get reply for: [id: 141, sessionId: 2FDE9D3A8B4E3072420A4E591E5E0ACA, method: Runtime.evaluate, params: {"expression":"(function(){ var fun = function(_){ return _.textContent.includes('Success!') }; var e = document.querySelector(\"body\"); return fun(e) })()","returnByValue":true}]
After some investigation, it seems that all communication with chrome fails after receiving a Target.detachedFromTarget
event:
websocket received text
<< {"method":"Target.detachedFromTarget","params":{"sessionId":"3E78AB1A4E9D86127767FB34AEB05AE0","targetId":"959F5DA50726B2D860A1AC58225E04A8"},"sessionId":"50BCEAE7F724D8D54F5FA85483BF4D07"}
<< ignore: [id: null, sessionId: 50BCEAE7F724D8D54F5FA85483BF4D07, method: Target.detachedFromTarget, params: {"sessionId":"3E78AB1A4E9D86127767FB34AEB05AE0","targetId":"959F5DA50726B2D860A1AC58225E04A8"}]
Notes
We are still able to successfully send raw messages using the method described at https://github.com/karatelabs/karate/blob/master/examples/ui-test/README.md#devtools-protocol-tips even after observing a Target.detachedFromTarget
event. In other words, it seems chrome / chrome debugging is still functioning properly but Karate is unable to communicate with it.
Background
Our “real” tests are failing when testing credit card entry which is powered by Stripe. Stripe uses the same pattern we’ve distilled in the attached reproducer to securely process credit card payments. In other words, we are unable change the underlying application to workaround this issue.
Reproducer:
How to run:
- build / install maven artifacts from latest develop branch locally
mvn clean install -P pre-release -pl -karate-robot
- run test in reproducer:
mvn test
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
Leaving this link here for googles to connect the two: https://github.com/karatelabs/karate/issues/1715
thanks @jkeys089 - everything seems to be passing in the CICD
@jkeys089 thank you ! I’ll keep this open until the “formal” 1.2.0 release, that’s just the process we follow for this project.