Chrome Driver with Karate 1.0.1 does not get frame tree
See original GitHub issueIn 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:
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:
- Created 2 years ago
- Comments:10 (6 by maintainers)
should be this week itself, 1.1.0 final. just waiting on a couple of other tickets
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.