question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chrome Driver with Karate 1.0.1 does not get frame tree

See original GitHub issue

In Karate 0.9.6 I was able to use the driver.send({ method: 'Page.getFrameTree' }) command to get the frametree which contained the unreachableUrl so I could get a value returned on a redirect to a nonexistant page.

When I upgraded to 1.0.1 the previously written code does not work. I found the solution was to add

if (result != null) { map.put("result", result); }

back to the toMap method in DevToolsMessage.java that was removed in this commit:

https://github.com/intuit/karate/commit/8f7d6e03604374a85fe7b8d52c81a23c2a45cace#diff-446634215c4ea0b238ab34920e7693aef931e0af453293a7cefd11119093a666L217

I’ve created an issue so I can create a PR to fix the issue.

I also would like to create a built in way to get the unreachable URL via adding the code below in DevToolsDriver.java

public String getUnreachableUrl() { DevToolsMessage dtm = method("Page.getFrameTree").send(); return dtm.getResult("frameTree.frame.unreachableUrl", String.class); }

I’ve created a simple project to show the failure. myproject.zip

Running mvn clean test will show that for cases where the url is not valid, the url will not return what is displayed in the chrome browser but will return ‘chrome-error://chromewebdata/’ hence the need to get the unreachableUrl which is returned in the frameTree.

Note: I reported the issue here on stack overflow: https://stackoverflow.com/questions/68491640/chrome-driver-with-karate-1-0-1-does-not-get-frame-tree

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ptrthomascommented, Aug 4, 2021

should be this week itself, 1.1.0 final. just waiting on a couple of other tickets

1reaction
PBMax02commented, Jul 27, 2021

@PBMax02 before implementing that I wonder what happens if there are multiple frames and one of them is unreachable etc. IMO this needs more thought

ah. I got you now. Ok. The original fix is what I needed to move forward. And your optimized code I can implement to make it more streamlined! Thanks for the fix and the guidance here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Chrome Driver with Karate 1.0.1 does not get frame tree
The issue is if you go to a url that is not resolvable you will get a chrome-error://chromewebdata value returned if you try...
Read more >
karate/README.md at master - GitHub
Here a batch-file called chrome can be placed in the system PATH (and made ... is not defined, Karate will even try to...
Read more >
How To Debug Karate In Chrome - ADocLib
Here a batchfile called chrome can be placed in the system PATH and made you can even use the Karate VS Code extension...
Read more >
ChromeDriver 99.0.4844.51 Update : error: target frame ...
I have to click on the button which does not have any iframe. So was trying defaultcontent but this did not work and...
Read more >
Index (karate-core 1.2.0.RC1 API) - Javadoc.io
IosDriver · activate() - Method in class com.intuit.karate.driver.chrome. ... Enter a parse tree produced by KarateParser.background() .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found