Using karate-UI
Given driver 'http://localhost:8080/auth/realms/auth?scope=openid&state=eferov08J37HlzbycjxHGs4.xzyoGFvM3QQ.test&response_type=code&client_id=hetg&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fauth%2Frealms%2Fendpoint'
* fullscreen()
And delay(2000)
And input('#username', 'username')
And input('#password', 'password')
When submit().click("#kc-login")
Then waitForUrl('http://localhost:8080/auth/realms/endpoint')
This URL contains a value which we want to extract. waitForUrl waits for this URL to come and once this URL is received how to proceed further. Is it possible to store this in some variable somehow? As all demos I saw is that input is mentioned or button can be clicked on this URL what about extracting a value from URL. How to store this URL so value can be extracted?
http://localhost:8080/auth/realms/endpoint?state=abbv&code=t6002231-3031-459f-b4c4-2e8a25223550.64f22bbc-6c28-49e4-bc2c-ca0ed40060de.36aee969-73e3-4bc5-bc5e-a4b68