To avoid Errors and Improve performance of the Selenium automation (Selenium RC+Java)

To Avoid Errors and Improve the performance of the Selenium automation coding(selenium RC+Java)
  1. Maintain a constant url while defining the setup(Instantiation of DefaultSelenium class) and selenium.open(url) to avoid the Permission Denied Error.
  2. Add the URL under Trusted sites to avoid Permission Denied Error
  3. If Changing from http to https, above mentioned 2 points would be an added advantage. But its advisable to use either http or https for any instance, or else, selenium would consider this as a foreign domain access and would throw permission denied error.
  4. To avoid the delays and speed up the automation run, avoid Thread.sleep() and wait commands as much as possible. Instead use waitForElementPresent and alternatively use webDriver which has much more feasibility with Selenium
  5. For Ajax related events, Avoid using selenium.typeKeys(), Instead use the combination of selenium.type & selenium.fireEvent. This approach gives more flexibility for ajax events
  6. For Ajax related drop down use for loop and verifyElementPresent to synchronise the time, Instead of wait command
  7. If test data is enormous(Multi dimensional or Multiple data like User Details-username, userid, password, etc), avoid declaring in the class files or property files. Instead use xml files and pharse the data using SAX parser.
Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s