Mine is not a loading problem program waits for 50 second after pages loads.
On Tue 6 Nov, 2018, 5:24 PM Sharat Oommen <[email protected] wrote: > I have faced this issue earlier. What I could understand is it could be > due to the network delays involved in loading the page sometimes. There are > two ways to avoid this based on my understanding. > 1) Dynamic sleep: > Something along the lines of this : > def sleep_while_id_not_present(element_id, print_string) > while [email protected](id: element_id).present? do > puts "sleeping 1 sec, whilst #{print_string}" > sleep 1 > end > end > Although Beware that this could cause race issues of its own. Be careful > when using this. > 2) You could get away using fire_event as it doesn't await confirmation. > read here: fire_event > <https://www.rubydoc.info/gems/watir-webdriver/0.9.9/Watir%2FElement:fire_event> > Hope this helps! > > Regards, > Sharat Oommen > On Tue, 6 Nov 2018 at 17:07, <[email protected]> wrote: > >> Hi Titus, >> >> I am facing weird problem, >> >> When I try to click the element, even after page arrives properly, it is >> waiting for 60 seconds and not clicking the button sometimes, it throws >> below error. but 4 out of 10 times it happens and rest of the time it runs >> successfully. What might be the problem? I never faced such a problem so >> far. >> >> >> Watir::Exception::UnknownObjectException: timed out after 60 seconds, >> waiting for #<Watir::HTMLElement: located: true; {:id=>"NavContinue"}> to >> be located >> >> 0) AGCSquoteCreation Test1 >> ?[31mFailure/Error: raise unknown_exception, msg?[0m >> ?[31m?[0m >> ?[31mWatir::Exception::UnknownObjectException:?[0m >> ?[31m timed out after 60 seconds, waiting for #<Watir::HTMLElement: >> located: true; {:id=>"NavContinue"}> to be located?[0m >> ?[36m# ./Source/FrameWorkModules/Elements/Button.rb:15:in >> `waitAndClick'?[0m >> ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:15:in `block >> in execute'?[0m >> ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in >> `each'?[0m >> ?[36m# ./Source/FrameWorkModules/Browser/Framework.rb:11:in >> `execute'?[0m >> ?[36m# ./Source/FrameWorkModules/Browser/PullTheTestCases.rb:16:in >> `call'?[0m >> ?[36m# ./Source/Run_Spec.rb:40:in `block (4 levels) in <top >> (required)>'?[0m >> ?[36m# ------------------?[0m >> ?[36m# --- Caused by: ---?[0m >> ?[36m# Watir::Wait::TimeoutError:?[0m >> ?[36m# timed out after 60 seconds, waiting for true condition on >> #<Watir::HTMLElement: located: true; {:id=>"NavContinue"}>?[0m >> ?[36m# ./Source/FrameWorkModules/Elements/Button.rb:15:in >> `waitAndClick'?[0m >> >> -- >> -- >> Before posting, please read >> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. >> >> In short: search before you ask, be nice. >> >> [email protected] >> http://groups.google.com/group/watir-general >> [email protected] >> --- >> You received this message because you are subscribed to the Google Groups >> "Watir General" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > -- > -- > Before posting, please read > https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. > > In short: search before you ask, be nice. > > [email protected] > http://groups.google.com/group/watir-general > [email protected] > --- > You received this message because you are subscribed to the Google Groups > "Watir General" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- -- Before posting, please read https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected] --- You received this message because you are subscribed to the Google Groups "Watir General" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
