2

Selenium's open command implicitly waits for the whole page to load, including images, etc.

How do I just wait for the DOM to load, like jQuery's .ready() method?

Currently, I'm using waitForElementPresent, but is there a better alternative?

Community
  • 1
  • 1
ma11hew28
  • 121,420
  • 116
  • 450
  • 651
  • 1
    Any reason you want to start interacting with the page before it's ready? Is it just to run tests faster? – pnewhook Feb 22 '11 at 15:10
  • Yes. I'm using Selenium to automate tasks on a photo website I don't own, and the automation, as in most cases, doesn't depend on the images being loaded. – ma11hew28 Feb 23 '11 at 13:48
  • How are you exercising the Selenium api? Are you using Selenium IDE? – Joshua Jewell Nov 16 '12 at 00:40

1 Answers1

0

I think you may try to do the following

  1. Tweak the selenium source code to stop it raising page reloaded flag.
  2. Use custom command or getEval to check if the dom is loaded and proceed.
Rajasankar
  • 928
  • 1
  • 19
  • 41