Environment vars can be used to specify options to pass to Selenium::Remote::Driver.
ENV vars are prefixed with
Set the Selenium server address with
Pick which browser is used using the
See Selenium::Driver::Remote for the meanings of these options.
Returns true if a Selenium server is running.
The host and port parameters are optional,
and default to
TWD_PORT can also be used to determine the server to check.
Below here are some methods that make things less easier or less wordy.
Get the text of a particular element. Wrapper around find_element()
Get the current text for the whole body.
Get the current URL.
Get the path part of the current browser location.
For Best Practice - I recommend subclassing Test::WebDriver for your application, and then refactoring common or app specific methods into MyApp::WebDriver so that your test files do not have much duplication. As your app changes, you can update MyApp::WebDriver rather than all the individual test files.
This work was sponsored by Prime Radiant, Inc.
Copyright (c) 2012 Prime Radiant, Inc.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.