26.11.2014 Views

Using Selenium for configuration management in Drupal

Using Selenium for configuration management in Drupal

Using Selenium for configuration management in Drupal

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

1 2 3 4 5 6 7 8 9 10<br />

Best Practices us<strong>in</strong>g <strong>Selenium</strong><br />

17. Use the "pause" command only <strong>for</strong> test<strong>in</strong>g based on the pass<strong>in</strong>g of<br />

time (which is rare). Instead use a "waitFor..." command such as<br />

"waitForElementPresent", "waitForTextPresent", etc. To make<br />

this work well, use a pattern like this:<br />

○ - assertElementNotPresent | id=foo<br />

○ - click | l<strong>in</strong>k="get foo"<br />

○ - waitForElementPresent | id=foo<br />

○ - [do someth<strong>in</strong>g with foo]<br />

● Pro: The "pause" time will eventually be too short or too long,<br />

based on variations <strong>in</strong> the test<strong>in</strong>g environment; if too short, the<br />

test will break; if it's too long, the test will be slower than<br />

necessary.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!