Thank you for the explanation.  Sometimes I forget that Selenium is being 
used under the covers and your explanation was great.  I was able to change 
the page timeout and it worked great.  

It makes sense to try to post on here first so I will remember to do that 
in the future.

On Friday, March 1, 2019 at 1:27:51 PM UTC-6, Marcin Erdmann wrote:
>
> Hi Jeremy,
>
> Thanks for posting the question to the list.
>
> This is not a Geb issue because the 5 minute timeout comes from selenium 
> and not Geb. 5 minutes is the default selenium page load timeout and it is 
> configurable via WebDrier.Timeouts.pageLoadTimeout() (
> https://static.javadoc.io/org.seleniumhq.selenium/selenium-api/2.50.1/org/openqa/selenium/WebDriver.Timeouts.html#pageLoadTimeout-long-java.util.concurrent.TimeUnit-).
>  
> Given an instance of a driver you can access the instance of 
> WebDrier.Timeouts using:
>
> driver.manage().timeouts() 
>
> What is essentially happening is the page you seem to be going to loads 
> for longer than 5 minutes. Selenium's default loading strategy (see 
> https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/PageLoadStrategy.html
>  
> and 
> https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/chrome/ChromeOptions.html#setPageLoadStrategy-org.openqa.selenium.PageLoadStrategy-)
>  
> waits for the page to fully load whenever WebDriver.get() is called 
> (happens under the covers when Browser.go(), Browser.to() or Browser.via() 
> are called) or a link/button is clicked which triggers an url change. 
> Changing of the page happens before at() is called so the control does not 
> even reach your at checker because selenium hangs for 5 minutes while 
> waiting for the page to load and then throws an exception.
>
> If you'd like to fail faster in that case I'd suggest configuring the page 
> load timeout via the method I linked to earlier in the email.
>
> Cheers,
> Marcin
>
> P.s. In the future it's best to first ask on this list and if the problem 
> you encountered turns out to be an actual issue in Geb then you will be 
> kindly asked to file an issue. I tend to close issues that are not problems 
> with Geb because issue tracker is for tracking issues and not answering 
> usage questions or solving users problems with the rest of the stack Geb is 
> using - it's what the mailing list is for.
>
> P.s.2 It's usually good practice to include the full stacktrace of the 
> failure you're experiencing when reporting problems. If you had I would be 
> able to point out that the the timeout happens when WebElement.click() is 
> called (I'm suspecting your login() method clicks on a button to login) and 
> not when at() is called.
>
> On Fri, Mar 1, 2019 at 5:19 PM <[email protected] <javascript:>> wrote:
>
>> We have an app I have been testing and my setupSpec() look something like 
>> this:
>>
>> def setupSpec() {
>>         go baseUrl
>>         login "username","password"
>>         at HomePage
>>     }
>>
>> It goes to a URL of a page but first we need to login, so I do that and 
>> then the app goes through a multi factor authentication which my user role 
>> skips. During this skip it is basically just a loading screen for usually 
>> about 5 seconds, and then it goes to our Home Page.
>>
>> The HomePage at look like this
>>
>> static at = {
>>         heading.text().toLowerCase().contains("home page")
>>     }
>>
>> I have atCheckWaiting = true in my GebConfig.groovy and so far everything 
>> has been working just fine. My waiting config is set to 10 seconds with a 
>> .5 second retry.
>>
>> However, we are currently experiencing an issue with our multi factor 
>> authentication and it's currently taking about 7-8 minutes to get through 
>> that loading screen. I would expect this test to fail after 10 seconds 
>> since that is what our default wait timeout is. What I am noticing is that 
>> the test fails at 5 minutes. I tried turning off atCheckWaiting and just 
>> putting a waitFor in the HomePage at checker, but the same thing is 
>> happening regardless of the value I set for the timeout.
>>
>> It seems that it's a 5 minute timeout and I can't see anywhere to change 
>> this. 5 minutes is a long time to wait to fail.
>>
>> I don't seem to have any issues with the atCheckWaiting outside of the 
>> setupSpec()...they seem to be following the global wait rules.
>>
>> I created an issue for Geb <https://github.com/geb/issues/issues/567>, 
>> because I thought this might be a bug but apparently it's because I am 
>> using it wrong?  To me it seems to be an issue with how the waits are 
>> handled in the setupSpec(), but if I am using it wrong I'd love to know 
>> what I am doing wrong.
>>
>> -- 
>> 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 [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/geb-user/4e1e6cae-8f22-4970-88c5-e5d68e55aa29%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/geb-user/4e1e6cae-8f22-4970-88c5-e5d68e55aa29%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/geb-user/9dbb8cd2-4f64-4cbe-97a0-99b8e0b160db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to