Testing: Selenium: ZimbraSelenium Tips

Revision as of 21:24, 4 May 2011 by Matthew Rhoades (talk | contribs) (Created page with '==General Information== This page details some helpful tips regarding usage of the Zimbra Selenium Harness ==Code== ===Selenium=== ====Locators==== Using the most optimal lo…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

General Information

This page details some helpful tips regarding usage of the Zimbra Selenium Harness

Code

Selenium

Locators

Using the most optimal locators is crucial for cross-browser compatibility. IE is notoriously slow for processing xpath locators. As per the Selenium documentation, the preferred format of locators is:

  1. by Identifier (i.e. locator="DWT233")
  2. by CSS (i.e. locator="css=a[href='#id3']")
  3. by xpath (i.e. locator="//a(@href='@id3']")
xpath to css translation
xpath css preferred usage
"xpath=//div[@id='foo']" "css=div[id='foo']" "foo" sIsElementPresent("foo")
"xpath=//div[@id='foo']" "css=div[id='foo']" "foo" sIsElementPresent("foo")


See http://saucelabs.com/blog/index.php/2010/01/selenium-totw-css-selectors-in-selenium-demystified/

See http://saucelabs.com/blog/index.php/2010/03/selenium-tips-finding-elements-by-their-inner-text-using-contains-a-css-pseudo-class/



Verified Against: unknown Date Created: 11/7/2007
Article ID: https://wiki.zimbra.com/index.php?title=Testing:_Selenium:_ZimbraSelenium_Tips Date Modified: 2011-05-04



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

Jump to: navigation, search