addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1linklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

Re: [ljc] Web Selenium

From: Gareth W.
Sent on: Wednesday, July 4, 2012 11:22 AM
+1

SauceLabs has a nice little CSS selector reference card: http://saucelabs.com/downloads/documentation/css-selector-quickreference.pdf

~Gareth

On 04/07/12 12:19, Alan Parkinson wrote:
I would be careful using HTMLUnit or HtmlUnitDriver when Javascript is involved. HTMLUnit uses the Rhino JavaScript engine and no major Web Browser uses it.

If your going to learn Selenium I would focus on the learning the WebDriver API (Selenium 2.0+) as this is where all the development effort is going within the project.

I would recommend avoiding xpath where possible for finding "elements" within a web page for two reasons:
 1) xpath lookup performance using IE is very very bad
 2) xpath lookups can be very brittle, just adding a single additional html element to page can often be enough to the stop the xpath lookup

Looking at the Groupon page they use a good amount of element id's and CSS classes within their HTML, so using CSS selectors to find elements should work well.

One tip I always give people new to Selenium is to learn about the page object pattern http://code.google.com/p/selenium/wiki/PageObjects It saves you a lot of pain in the long run when you have to maintain a suite of tests

Cheers,

Alan

Our Sponsors

  • Our Blog

    Read the latest news from the LJC

  • RecWorks Ltd

    Fixing Tech Recruitment using the Power of Community

  • jClarity

    Java/JVM Performance Analysis Tools & mentoring for Java related matters

  • LJC Aggrity

    Our LJC Aggrity site contains blog posts from our members

  • LJC Book Club

    Our Book club with book reviews from our members

  • Devoxx UK

    Java Community Conference in collaboration with the LJC, 8-10th June 16

  • SkillsMatter

    "Host, help organise, promote, film many of our meetings."

  • IBM

    Build Enterprise-grade apps at start-up speed.

  • New Relic

    New Relic makes sense of billions of metrics a day in real time.

  • Hazelcast

    Hazelcast is the leader in operating in-memory computing.

  • Java.Net

    We are an official Java User Group recognised by Oracle's JUG program

  • JRebel

    Free 3 month J-Rebel license.

  • O'Reilly

    40% discount on printed books and 50% on e-books.

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy