can i NOT wait for a page to load?

18 views
Skip to first unread message

Brandon Brown

unread,
Oct 18, 2016, 12:46:22 PM10/18/16
to Selenium Remote Driver
I've run into an issue where pages are taking up to a minute to load. I think it is an issue with the remote server but since I don't control this I can't fix it. I've logged a ticket with them. It suddenly started happening so now all my $sel->open() commands timeout. Is there a way to NOT wait_for_page_to_load and instead look for wait_for_element_present when doing an ->open()? I'm using WWW::Selenium.

Thanks in advance,
Brandon

Daniel Gempesaw

unread,
Oct 18, 2016, 1:44:19 PM10/18/16
to Selenium Remote Driver

Hmm, WWW::Selenium and the associated SeleniumRC 1.0 stuff has been deprecated for a few years now, in favor of Selenium Webdriver 2.X (and even 3.0 - there are Selenium Webdriver 3.0 betas out now). Unfortunately, I have no idea how to accomplish this with Selenium RC - perhaps this set_timeout method is what you’re looking for? I’m not really sure…

FWIW, with Selenium::Remote::Driver and using Webdriver, you’d use S::R::D's set_timeout with the timeout name of page load as discussed in the POD for that method and set it to an appropriate value. Afterwards, I think attempting to load a page that exceeds the custom timeout will throw an exception that S::R::D with turn into a die that you’ll probably want to catch and handle appropriately.

I’d assume it’s generally similar in SeleniumRC (manage a timeout value with a different subroutine, then call the subroutine for loading a page), but again I don’t have any experience with RC anymore and no idea if my assumption actually holds water.

Good luck!

Brandon Brown

unread,
Oct 18, 2016, 6:49:26 PM10/18/16
to Selenium Remote Driver
thanks Daniel. that's helpful. Yeah i started this project without realizing i was using a depracated package. Bummer....
Reply all
Reply to author
Forward
0 new messages