Reload web page after timeout
Page 1 of 1 • Share •
Reload web page after timeout
How can i reload the page after it is timeout?
Now, if the url timeout, testing stop, how could I modify the following code to let it reload again?
$this->open($url);
$this->waitForPageToLoad($pagetimeout);
i try to use
try {
$this->open($url);
$this->waitForPageToLoad($pagetimeout);
} catch (Exception $e) {
}
but i am fail too
Anyone can help? Thanks!!
Now, if the url timeout, testing stop, how could I modify the following code to let it reload again?
$this->open($url);
$this->waitForPageToLoad($pagetimeout);
i try to use
try {
$this->open($url);
$this->waitForPageToLoad($pagetimeout);
} catch (Exception $e) {
}
but i am fail too
Anyone can help? Thanks!!
fireghost- Posts: 3
Join date: 2012-01-19
Re: Reload web page after timeout
I didn't do it before, so I don't know if it is the best solution and if it works, but try this:
Please let me know if it is OK.
- Code:
$time = $pagetimeout / 1000;
for ($second = 0; ; $second++) {
if ($second >= $time) {
$this->refresh(); //simulation of clicking the "Refresh" button
//or open the url once again
//$this->open($url);
}
try {
if ($this->isTextPresent("some text which is presented at the page you are trying to open")) {
break;
}
} catch (Exception $e) {}
sleep(1);
}
Please let me know if it is OK.
faramka- Professional

- Posts: 143
Join date: 2011-09-15
Location: Poland
Re: Reload web page after timeout
thanks!!
I will try it tonight and report the result here!
thanks again first!
I will try it tonight and report the result here!
thanks again first!
fireghost- Posts: 3
Join date: 2012-01-19
Re: Reload web page after timeout
OK, so we will continue resolving this issue on Monday (if this one isn't good solution) 
faramka- Professional

- Posts: 143
Join date: 2011-09-15
Location: Poland
Re: Reload web page after timeout
i just try it but it fail
after I search around, i think it is the limitation of Selenium
As the "open" function is already include "wait" condition, if fail, trigger timeout.
seems no other method to stop the trigger.
for example, if i want to open 10 url and record down the loading time,
if any one of the url fail to load and trigger timeout, the rest of the url can't be record.
i just thinking how can i stop the trigger and continue the rest of the url.
it is trouble~~
after I search around, i think it is the limitation of Selenium
As the "open" function is already include "wait" condition, if fail, trigger timeout.
seems no other method to stop the trigger.
for example, if i want to open 10 url and record down the loading time,
if any one of the url fail to load and trigger timeout, the rest of the url can't be record.
i just thinking how can i stop the trigger and continue the rest of the url.
it is trouble~~
fireghost- Posts: 3
Join date: 2012-01-19
Similar topics» Off-page optimization Tips
» Samsung all hardware solution in one page.. daily updated.. get..set.. go..
» Reload web page after timeout
» How to test the session timeout of a web application
» Can any one suggest what command could be used for refreshing a page using c sharp
» Samsung all hardware solution in one page.. daily updated.. get..set.. go..
» Reload web page after timeout
» How to test the session timeout of a web application
» Can any one suggest what command could be used for refreshing a page using c sharp
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
» sample webdriver code for php users
» which standalone server to use
» Dynamic Drop Down Selection
» It is possible to find list of all URL's exist in any web page in selenium ide
» It is possible to compare 2 same images in selenium IDE.
» how to compare 2 ULR's which is exist in same web page (View page source).
» Web Driver: Unable to click a link present inside the frame of a frameset
» Help me to get dynamicaly loaded options of dropdown in Selenium RC -Junit test case