0

I am using selenium IEDriverServer along with python.

Is it possible to make sure that IEDriverServer waits for a page to load , until some time and if the operation is not complete in time then it stops loading the page and we can proceed to next step.

Actually i am using a test page which contains takes too much time to load. All i am trying to do is to let it wait for the page to load until 10 sec and if it is unable to load in that time then it stops loading that page and moves over to the next step.

Can anyone suggest how this can be achieved in selenium

user2587419
  • 69
  • 1
  • 2
  • 6
  • 1
    I'm not sure I follow - you want to wait an arbitrary 10 secs or so for the wait to finish loading but if it hasn't finished loading after those 10 secs have passed, you wish to continue with your test. Surely you can't continue with your test as your page will not have finished loading? – Mark Rowlands Jul 23 '13 at 13:21
  • Exactly as you said. That is the situation i am facing. – user2587419 Jul 30 '13 at 05:44
  • But again, if you page doesn't load you can't continue with your test. So there's no point waiting a limit and trying to continue because you can't. You could only continue with the test if and when the page completes loading. – Mark Rowlands Jul 30 '13 at 07:49
  • I had similar issue about waiting for a prompt; you can read the aswer [here](http://stackoverflow.com/questions/19003003/check-if-any-alert-exists-using-selenium-with-python?answertab=active#tab-top). – Zeinab Abbasimazar Nov 07 '13 at 22:41

1 Answers1

0

Webdriver has both implicit waits as well as explicit waits.

Implicit means it implicitly waits for the specified time on all actions.

driver.implicitly_wait(10)

Explicit means you can specify to wait for an expected condition to be met, which can be set for a page or some specific element

element = wait.until(EC.element_to_be_clickable((By.ID,'someid')))

Documentation here

haraprasadj
  • 1,059
  • 1
  • 8
  • 17