- BEST PRACTICES
- COPYRIGHT AND LICENSE
Following these guidelines will make your life easier when writing Selenium tests. They are listed in order of importance.
However using these methods will make your tests take a long time and will cause hard to reproduce intermittent failures and generally drive you crazy.
If your page uses jQuery, use jquery_wait_for_page_to_load_ok().
If your page doesn't use jQuery you can use wait_for_text_present_ok() in most cases.
CSS can't choose the nth thing in a list or table. XPATH can. For the sake of consistency you may want to stay with XPATH.
Most methods allow you to pass along a comment. The comment shows up in your TAP output.
For example. Sometimes when using XPATH, you should add a comment to the test output. You can do that like this:
$selenium->click_ok('//table/tbody/tr/td/input[name=foo]', "click 3rd checkbox")
This works like Test::More::note().
Eric Johnson <kablamo at iijo dot nospamthanks dot org>
This software is copyright (c) 2012 by Eric Johnson.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.