Wait for URL to change

7 views
Skip to first unread message

Ben Frey

unread,
Aug 25, 2020, 12:06:34 PM8/25/20
to Geb User Mailing List
In the automation I'm working on, there is a long series of questions with Yes/No radio buttons. I want to answer "No" to all of them. The weird thing is that there is JavaScript attached to the "No" radio buttons that will move to the next question, rather than the user needing to click the "Next" button.The URL itself does change, so if there's a nice way to wait for that, that would be ideal.

Jeremy Cattau

unread,
Aug 25, 2020, 12:10:45 PM8/25/20
to geb-...@googlegroups.com
Could you do something like url.contains() or .endsWith()?

On Tue, Aug 25, 2020, 11:06 AM Ben Frey <sparta...@gmail.com> wrote:
In the automation I'm working on, there is a long series of questions with Yes/No radio buttons. I want to answer "No" to all of them. The weird thing is that there is JavaScript attached to the "No" radio buttons that will move to the next question, rather than the user needing to click the "Next" button.The URL itself does change, so if there's a nice way to wait for that, that would be ideal.

--
You received this message because you are subscribed to the Google Groups "Geb User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geb-user+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/geb-user/7f4073df-67a6-4d05-8a07-f29bf93bc382n%40googlegroups.com.

Thomas Hirsch

unread,
Aug 25, 2020, 12:11:47 PM8/25/20
to Geb User Mailing List
Hi Ben, 

There is a method getCurrentUrl() on the https://gebish.org/manual/current/api/geb/Browser.html class.
You can also always fallback to the Selenium WebDriver object via the browser.getDriver() method.

Thomas

Ben Frey

unread,
Aug 25, 2020, 2:27:09 PM8/25/20
to Geb User Mailing List
Thanks, getCurrentUrl() will work just fine.
Reply all
Reply to author
Forward
0 new messages