SlideShare a Scribd company logo
1 of 29
Automated Web Testing: Traps for
the Unwary
Simon Stewart, Selenium Project
Simon is best known as the lead of the Selenium
project and is the creator of the WebDriver APIs. He
has been the Tech Lead of Google’s Browser
Infrastructure team and has previously worked at
ThoughtWorks.
He loves code.
www.eurostarconferences.com
Join the conversation on Twitter
#esconfs
@esconfs
@shs96c
www.eurostarconferences.com
Continue the conversation with the speaker on Twitter after the show!
The Three Things You Need to Know
• How to find things
• How to wait for things
• How to keep your code
clean
http://www.flickr.com/photos/hfiguiere/4802869688/
FINDING THINGS
How to Find Things
• Find by
– id
– name
– css selector
– xpath
http://www.flickr.com/photos/icesabre/2142494372/
Why XPath is a Bad Idea
http://www.flickr.com/photos/38194075@N05/4430503343/
And Why It’s Not
http://www.flickr.com/photos/robives/7134916437/
Why CSS Locators are Preferable
• Shared with design and
UX
• Less brittle
http://www.flickr.com/photos/ervega/3662623495/
Using Javascript to Locate Elements
http://www.flickr.com/photos/biker_jun/4138642796/
Custom Bys
• ARIA
• JQuery
WAITING
How a Web App Communicates With
a Server
Other Causes for Delays
• Native events
• window.setTimeout
• Local JS processing
• WebWorkers
Implicit Waiting
Explicit Waits
Wait<X>, FluentWait<X>, WebDriver
Wait
Expected Conditions
Writing New Expected Conditions
• Extend « ExpectedCondition »
• Can be as complex as you like
CLEAN CODE
The DRY Principle
http://www.flickr.com/photos/remibridot/2218573670/
Page Objects: Applying OO and DRY
to Test Code
• Reflect services offered
to users
• Are the only place with
deep knowledge of
page structure
• Can be composed
http://www.flickr.com/photos/dandiffendale/7891256336/
PageFactory
LoadableComponent
SlowLoadableComponent
There Are Other Ways
• Narrative-based
frameworks
• Scenarios and Steps in
BDD
• Custom DSLs
http://www.flickr.com/photos/dolmansaxlil/6779097439/
www.eurostarconferences.com
Questions?
EuroSTAR Webinar Archive
Access almost 50 on-demand software testing webinars by the world's leading
testing experts. Topics include….
www.eurostarconferences.com
Agile, Automation, Test Management, Process Improvements, Risk-based Testing, Performance
Testing, Test Documentation, Cloud Testing, Session-based Testing, Weekend Testers
Visit the archive!
http://www.eurostarconferences.com/community/member/webinar-archive
@esconfs
#esconfs
The EuroSTAR Community.
Are you a member?
Did you know we have an online resource area with almost …
www.eurostarconferences.com
600 software testing presentations, 50 topical
webinars, over 40 videos and podcasts and 20 expert
eBooks
Do you know that membership is completely free and you can access these
premium testing resources anytime?
Join today!
http://www.eurostarconferences.com/community/
member
@esconfs
#esconfs
Call for Submissions to speak at the 2013 EuroSTAR
Conference is now open!
Speak at Europe’s #1 Software Testing Event
Theme: Questioning Testing Deadline for submissions February 13th
For more information http://www.eurostarconferences.com/speakers/conference-2013-call-
for-submissions

More Related Content

More from TEST Huddle

Will Robots Replace Testers?
Will Robots Replace Testers?Will Robots Replace Testers?
Will Robots Replace Testers?TEST Huddle
 
TDD For The Rest Of Us
TDD For The Rest Of UsTDD For The Rest Of Us
TDD For The Rest Of UsTEST Huddle
 
Scaling Agile with LeSS (Large Scale Scrum)
Scaling Agile with LeSS (Large Scale Scrum)Scaling Agile with LeSS (Large Scale Scrum)
Scaling Agile with LeSS (Large Scale Scrum)TEST Huddle
 
Creating Agile Test Strategies for Larger Enterprises
Creating Agile Test Strategies for Larger EnterprisesCreating Agile Test Strategies for Larger Enterprises
Creating Agile Test Strategies for Larger EnterprisesTEST Huddle
 
Is There A Risk?
Is There A Risk?Is There A Risk?
Is There A Risk?TEST Huddle
 
Are Your Tests Well-Travelled? Thoughts About Test Coverage
Are Your Tests Well-Travelled? Thoughts About Test CoverageAre Your Tests Well-Travelled? Thoughts About Test Coverage
Are Your Tests Well-Travelled? Thoughts About Test CoverageTEST Huddle
 
Growing a Company Test Community: Roles and Paths for Testers
Growing a Company Test Community: Roles and Paths for TestersGrowing a Company Test Community: Roles and Paths for Testers
Growing a Company Test Community: Roles and Paths for TestersTEST Huddle
 
Do we need testers on agile teams?
Do we need testers on agile teams?Do we need testers on agile teams?
Do we need testers on agile teams?TEST Huddle
 
How to use selenium successfully
How to use selenium successfullyHow to use selenium successfully
How to use selenium successfullyTEST Huddle
 
Testers & Teams on the Agile Fluency™ Journey
Testers & Teams on the Agile Fluency™ Journey Testers & Teams on the Agile Fluency™ Journey
Testers & Teams on the Agile Fluency™ Journey TEST Huddle
 
Practical Test Strategy Using Heuristics
Practical Test Strategy Using HeuristicsPractical Test Strategy Using Heuristics
Practical Test Strategy Using HeuristicsTEST Huddle
 
Thinking Through Your Role
Thinking Through Your RoleThinking Through Your Role
Thinking Through Your RoleTEST Huddle
 
Using Selenium 3 0
Using Selenium 3 0Using Selenium 3 0
Using Selenium 3 0TEST Huddle
 
New Model Testing: A New Test Process and Tool
New Model Testing:  A New Test Process and ToolNew Model Testing:  A New Test Process and Tool
New Model Testing: A New Test Process and ToolTEST Huddle
 
Five Digital Age Trends That Will Dramatically Impact Testing And Quality Sk...
 Five Digital Age Trends That Will Dramatically Impact Testing And Quality Sk... Five Digital Age Trends That Will Dramatically Impact Testing And Quality Sk...
Five Digital Age Trends That Will Dramatically Impact Testing And Quality Sk...TEST Huddle
 
Can virtualization transform your API lifecycle?
Can virtualization transform your API lifecycle?Can virtualization transform your API lifecycle?
Can virtualization transform your API lifecycle?TEST Huddle
 
The world class webinar series
The world class webinar seriesThe world class webinar series
The world class webinar seriesTEST Huddle
 
Scrum in Hardware
Scrum in HardwareScrum in Hardware
Scrum in HardwareTEST Huddle
 
How to get Automated Testing "Done"
How to get Automated Testing "Done"How to get Automated Testing "Done"
How to get Automated Testing "Done"TEST Huddle
 
Test process improvement – how hard can it be?
Test process improvement – how hard can it be?Test process improvement – how hard can it be?
Test process improvement – how hard can it be?TEST Huddle
 

More from TEST Huddle (20)

Will Robots Replace Testers?
Will Robots Replace Testers?Will Robots Replace Testers?
Will Robots Replace Testers?
 
TDD For The Rest Of Us
TDD For The Rest Of UsTDD For The Rest Of Us
TDD For The Rest Of Us
 
Scaling Agile with LeSS (Large Scale Scrum)
Scaling Agile with LeSS (Large Scale Scrum)Scaling Agile with LeSS (Large Scale Scrum)
Scaling Agile with LeSS (Large Scale Scrum)
 
Creating Agile Test Strategies for Larger Enterprises
Creating Agile Test Strategies for Larger EnterprisesCreating Agile Test Strategies for Larger Enterprises
Creating Agile Test Strategies for Larger Enterprises
 
Is There A Risk?
Is There A Risk?Is There A Risk?
Is There A Risk?
 
Are Your Tests Well-Travelled? Thoughts About Test Coverage
Are Your Tests Well-Travelled? Thoughts About Test CoverageAre Your Tests Well-Travelled? Thoughts About Test Coverage
Are Your Tests Well-Travelled? Thoughts About Test Coverage
 
Growing a Company Test Community: Roles and Paths for Testers
Growing a Company Test Community: Roles and Paths for TestersGrowing a Company Test Community: Roles and Paths for Testers
Growing a Company Test Community: Roles and Paths for Testers
 
Do we need testers on agile teams?
Do we need testers on agile teams?Do we need testers on agile teams?
Do we need testers on agile teams?
 
How to use selenium successfully
How to use selenium successfullyHow to use selenium successfully
How to use selenium successfully
 
Testers & Teams on the Agile Fluency™ Journey
Testers & Teams on the Agile Fluency™ Journey Testers & Teams on the Agile Fluency™ Journey
Testers & Teams on the Agile Fluency™ Journey
 
Practical Test Strategy Using Heuristics
Practical Test Strategy Using HeuristicsPractical Test Strategy Using Heuristics
Practical Test Strategy Using Heuristics
 
Thinking Through Your Role
Thinking Through Your RoleThinking Through Your Role
Thinking Through Your Role
 
Using Selenium 3 0
Using Selenium 3 0Using Selenium 3 0
Using Selenium 3 0
 
New Model Testing: A New Test Process and Tool
New Model Testing:  A New Test Process and ToolNew Model Testing:  A New Test Process and Tool
New Model Testing: A New Test Process and Tool
 
Five Digital Age Trends That Will Dramatically Impact Testing And Quality Sk...
 Five Digital Age Trends That Will Dramatically Impact Testing And Quality Sk... Five Digital Age Trends That Will Dramatically Impact Testing And Quality Sk...
Five Digital Age Trends That Will Dramatically Impact Testing And Quality Sk...
 
Can virtualization transform your API lifecycle?
Can virtualization transform your API lifecycle?Can virtualization transform your API lifecycle?
Can virtualization transform your API lifecycle?
 
The world class webinar series
The world class webinar seriesThe world class webinar series
The world class webinar series
 
Scrum in Hardware
Scrum in HardwareScrum in Hardware
Scrum in Hardware
 
How to get Automated Testing "Done"
How to get Automated Testing "Done"How to get Automated Testing "Done"
How to get Automated Testing "Done"
 
Test process improvement – how hard can it be?
Test process improvement – how hard can it be?Test process improvement – how hard can it be?
Test process improvement – how hard can it be?
 

Recently uploaded

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

'Automated Web Testing: Traps for the Unwary' by Simon stewart

  • 1. Automated Web Testing: Traps for the Unwary Simon Stewart, Selenium Project Simon is best known as the lead of the Selenium project and is the creator of the WebDriver APIs. He has been the Tech Lead of Google’s Browser Infrastructure team and has previously worked at ThoughtWorks. He loves code. www.eurostarconferences.com
  • 2. Join the conversation on Twitter #esconfs @esconfs @shs96c www.eurostarconferences.com Continue the conversation with the speaker on Twitter after the show!
  • 3. The Three Things You Need to Know • How to find things • How to wait for things • How to keep your code clean http://www.flickr.com/photos/hfiguiere/4802869688/
  • 5. How to Find Things • Find by – id – name – css selector – xpath http://www.flickr.com/photos/icesabre/2142494372/
  • 6. Why XPath is a Bad Idea http://www.flickr.com/photos/38194075@N05/4430503343/
  • 7. And Why It’s Not http://www.flickr.com/photos/robives/7134916437/
  • 8. Why CSS Locators are Preferable • Shared with design and UX • Less brittle http://www.flickr.com/photos/ervega/3662623495/
  • 9. Using Javascript to Locate Elements http://www.flickr.com/photos/biker_jun/4138642796/
  • 12. How a Web App Communicates With a Server
  • 13. Other Causes for Delays • Native events • window.setTimeout • Local JS processing • WebWorkers
  • 18. Writing New Expected Conditions • Extend « ExpectedCondition » • Can be as complex as you like
  • 21. Page Objects: Applying OO and DRY to Test Code • Reflect services offered to users • Are the only place with deep knowledge of page structure • Can be composed http://www.flickr.com/photos/dandiffendale/7891256336/
  • 25. There Are Other Ways • Narrative-based frameworks • Scenarios and Steps in BDD • Custom DSLs http://www.flickr.com/photos/dolmansaxlil/6779097439/
  • 27. EuroSTAR Webinar Archive Access almost 50 on-demand software testing webinars by the world's leading testing experts. Topics include…. www.eurostarconferences.com Agile, Automation, Test Management, Process Improvements, Risk-based Testing, Performance Testing, Test Documentation, Cloud Testing, Session-based Testing, Weekend Testers Visit the archive! http://www.eurostarconferences.com/community/member/webinar-archive @esconfs #esconfs
  • 28. The EuroSTAR Community. Are you a member? Did you know we have an online resource area with almost … www.eurostarconferences.com 600 software testing presentations, 50 topical webinars, over 40 videos and podcasts and 20 expert eBooks Do you know that membership is completely free and you can access these premium testing resources anytime? Join today! http://www.eurostarconferences.com/community/ member @esconfs #esconfs
  • 29. Call for Submissions to speak at the 2013 EuroSTAR Conference is now open! Speak at Europe’s #1 Software Testing Event Theme: Questioning Testing Deadline for submissions February 13th For more information http://www.eurostarconferences.com/speakers/conference-2013-call- for-submissions

Editor's Notes

  1. There are other mechanisms (such as link text), but we’ll not be paying attention to them for now.Note that although ids should be unique they very seldom are.
  2. Three main reasons. it can be very brittle as the tools used to create them automatically tie the expression very closely to the page: it won’t survive a refactoring.Xpath engines work at different speeds. On IE there isn’t one available for an HTML DOM, so we use one written in JS, but JS on IE is slower than on any other browserDifferent browsers interpret HTML differently. The page structure may well be different in different browsers
  3. Best way to find a parent node (“..”)Can be a useful way of narrowing down a subset of the DOM (eg: finding all TR elements when there are nested tables)
  4. Whereas Xpath tends to only be used by testers, CSS selectors are often shared with UX and/or designers. They are less brittleSelectors located by machine tend to be far less brittle
  5. What if you’re using JQuery?Also a really good way to implement “Gray Box” testing: have the app provide useful JS functions to grab bits of the UI. Gmonkey in Gmail provides access to key parts of the UI in this way.
  6. Demo implmentation
  7. Watch out for the StaleElementReferenceException