1

when I do UI test in karate, I want to get a request url from web, the page will not load, every time the request url will have a unique code in it, the code is what I need in later test.

I cannot use * def actualUrl = waitForUrl('*') to get it because it will give "chrome-error://chromewebdata/", and * def currentUrl = driver.execute_Script("return window.location.href;") is not able to use, karate says execute_Script is not a defined method. Please help, thank you enter image description here

2 Answers 2

0

Sounds like the page wasn't even loaded.

See if this answer helps: https://stackoverflow.com/a/66813293/143475

Also refer: https://stackoverflow.com/a/61678536/143475

Sign up to request clarification or add additional context in comments.

1 Comment

seems different with what I need...I don't have to open a new tab, I don't have the whole expected request either,,,,the reason I need the request url is, everytime that request will give a unique code at last of the url, and I want to get that code...the page will not loaded, I just want to get that request url from UI test. Could you please help?
0

I have found a method to solve my question:

def frameTree = driver.send({ method: 'Page.getFrameTree' })

I can use this sentence to get the unreachableUrl

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.