SlideShare a Scribd company logo
1 of 16
Download to read offline
XPath alternative for Browser
Automation in IE
Mridul Bansal
Graduate Student, Software Engineering (Dec’11)
San Jose State University

Software QA Intern @Citrix, CA
Software Test Development Intern @Hara, CA
Software Test Engineer @Covelix, India

http://www.linkedin.com/in/mridulbansal




About Me
Automation in IE using
         Webdriver!!!




Problem Statement
  n00b



  Lot   has already been said…


  Take   with a pinch of salt



Caution!
IE9


Caution!
  Dynamic     id


  XPath



  Handles     XPath differently


  Painfully   Slow


Why?
  Increase    timeout


  CSS



  Alternate   locators



Fix?
  Nokogiri    (Ruby)   http://nokogiri.org/

gem install nokogiri

require ‘nokogiri’




iFix
Earlier
@driver.find_element(:xpath => "//span[contains(., ABC')]").click



                                   Now

src = "<div id=""treeForm:tree:childs"">#{@driver.page_source()}</
  div>"

curr_id = Nokogiri::HTML(src).xpath("//div[@id =
  'treeForm:tree:childs']/div[1]/div[2]/table[11]").attribute("id")

@driver.find_element(:id, curr_id).click




How?
  Test
    execution time on FF3.6 using
 Webdriver = 3:00


  Test
    execution time on IE9 using
 Webdriver = 4:50




Benchmarks
  HtmlCleaner   -   http://htmlcleaner.sourceforge.net/




Alternatives
  http://nokogiri.org/
  http://php.jglobal.com/blog/?
   tag=selenium
  http://www.qaautomation.net/?p=216
  http://blog.altom.ro/2010/10/selenium-
   xpath-and-internet-explorer.html




References
  Selenium   Meetup

  Hara


  Huynh   Kang




Credits
©	
  
             2011	
  
             Hara	
  
                     /	
  
             confi
             den0


Open House
               al	
  /	
  
             Page	
  
                14	
  
Appreciate in Public,
    Criticize in private…
    Recommend on LinkedIn! 


                                  ©	
  
                               2011	
  
                               Hara	
  
                                       /	
  
                               confi
                               den0


My Takeaway!
                                 al	
  /	
  
                               Page	
  
                                  15	
  
Mridul Bansal
Graduate Student, Software Engineering (Dec’11)
San Jose State University

Software QA Intern @Citrix, CA
Software Test Development Intern @Hara, CA
Software Test Engineer @Covelix, India

http://www.linkedin.com/in/mridulbansal




Thanks for bearing!!

More Related Content

Similar to #SFSE: XPath Alternative for Browser Automation in IE

Similar to #SFSE: XPath Alternative for Browser Automation in IE (10)

ASHWINI MULEKASTURE_JS (3)
ASHWINI  MULEKASTURE_JS (3)ASHWINI  MULEKASTURE_JS (3)
ASHWINI MULEKASTURE_JS (3)
 
7 - Top ten tips for a SharePoint Succesfull Deployment, por Joel Oleson
7 - Top ten tips for a SharePoint Succesfull Deployment, por Joel Oleson7 - Top ten tips for a SharePoint Succesfull Deployment, por Joel Oleson
7 - Top ten tips for a SharePoint Succesfull Deployment, por Joel Oleson
 
Visual Studio 2019 × Azureで簡単アプリ開発!
Visual Studio 2019 × Azureで簡単アプリ開発!Visual Studio 2019 × Azureで簡単アプリ開発!
Visual Studio 2019 × Azureで簡単アプリ開発!
 
Resume English
Resume EnglishResume English
Resume English
 
Huned hita india l-atest
Huned hita india   l-atestHuned hita india   l-atest
Huned hita india l-atest
 
[Resume CV] Sepehr Soltanieh
[Resume CV] Sepehr Soltanieh[Resume CV] Sepehr Soltanieh
[Resume CV] Sepehr Soltanieh
 
Share point 2013 unveiled
Share point 2013 unveiledShare point 2013 unveiled
Share point 2013 unveiled
 
lokeshsolanki.doc
lokeshsolanki.doclokeshsolanki.doc
lokeshsolanki.doc
 
Making Cool Apps from Kits with Java, Oracle ADF, & UX Design Patterns
Making Cool Apps from Kits with Java, Oracle ADF, & UX Design PatternsMaking Cool Apps from Kits with Java, Oracle ADF, & UX Design Patterns
Making Cool Apps from Kits with Java, Oracle ADF, & UX Design Patterns
 
Android Resume | Android Training call @845-915-8712
Android Resume | Android Training call @845-915-8712Android Resume | Android Training call @845-915-8712
Android Resume | Android Training call @845-915-8712
 

More from Sauce Labs

Your Framework for Success: introduction to JavaScript Testing at Scale
Your Framework for Success: introduction to JavaScript Testing at ScaleYour Framework for Success: introduction to JavaScript Testing at Scale
Your Framework for Success: introduction to JavaScript Testing at Scale
Sauce Labs
 
Automating Hybrid Applications with Appium
Automating Hybrid Applications with AppiumAutomating Hybrid Applications with Appium
Automating Hybrid Applications with Appium
Sauce Labs
 
Quality at Speed: More API Testing, Less UI Testing
Quality at Speed: More API Testing, Less UI TestingQuality at Speed: More API Testing, Less UI Testing
Quality at Speed: More API Testing, Less UI Testing
Sauce Labs
 
Creating Digital Confidence with Test Automation
Creating Digital Confidence with Test AutomationCreating Digital Confidence with Test Automation
Creating Digital Confidence with Test Automation
Sauce Labs
 

More from Sauce Labs (20)

Simplify Salesforce Testing with AI-Driven Codeless Tools
Simplify Salesforce Testing with AI-Driven Codeless ToolsSimplify Salesforce Testing with AI-Driven Codeless Tools
Simplify Salesforce Testing with AI-Driven Codeless Tools
 
Testing on Mobile Devices with Location Services
Testing on Mobile Devices with Location ServicesTesting on Mobile Devices with Location Services
Testing on Mobile Devices with Location Services
 
Your Framework for Success: introduction to JavaScript Testing at Scale
Your Framework for Success: introduction to JavaScript Testing at ScaleYour Framework for Success: introduction to JavaScript Testing at Scale
Your Framework for Success: introduction to JavaScript Testing at Scale
 
Automating Hybrid Applications with Appium
Automating Hybrid Applications with AppiumAutomating Hybrid Applications with Appium
Automating Hybrid Applications with Appium
 
Quality at Speed: More API Testing, Less UI Testing
Quality at Speed: More API Testing, Less UI TestingQuality at Speed: More API Testing, Less UI Testing
Quality at Speed: More API Testing, Less UI Testing
 
Creating Digital Confidence with Test Automation
Creating Digital Confidence with Test AutomationCreating Digital Confidence with Test Automation
Creating Digital Confidence with Test Automation
 
Just Enough (Automated) Testing
Just Enough (Automated) TestingJust Enough (Automated) Testing
Just Enough (Automated) Testing
 
Using Axe to Add Accessibility Checks to Your Existing Selenium Tests
Using Axe to Add Accessibility Checks to Your Existing Selenium TestsUsing Axe to Add Accessibility Checks to Your Existing Selenium Tests
Using Axe to Add Accessibility Checks to Your Existing Selenium Tests
 
How Open Source Helps to Bring Back Product Obsession
How Open Source Helps to Bring Back Product ObsessionHow Open Source Helps to Bring Back Product Obsession
How Open Source Helps to Bring Back Product Obsession
 
Webinar: A Sneak Peek at Selenium 4 with Simon Stewart
Webinar: A Sneak Peek at Selenium 4 with Simon StewartWebinar: A Sneak Peek at Selenium 4 with Simon Stewart
Webinar: A Sneak Peek at Selenium 4 with Simon Stewart
 
[Deu] Test Automatisierung Mit Web Driver.io
[Deu] Test Automatisierung Mit Web Driver.io[Deu] Test Automatisierung Mit Web Driver.io
[Deu] Test Automatisierung Mit Web Driver.io
 
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...
 
Accelerating Your Digital Agenda with Continuous Testing ft. Forrester
Accelerating Your Digital Agenda with Continuous Testing ft. ForresterAccelerating Your Digital Agenda with Continuous Testing ft. Forrester
Accelerating Your Digital Agenda with Continuous Testing ft. Forrester
 
How to Measure Success in Continuous Testing
How to Measure Success in Continuous TestingHow to Measure Success in Continuous Testing
How to Measure Success in Continuous Testing
 
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...
 
5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation
 
Sauce Labs Webinar: Rising Importance of Software Testing
Sauce Labs Webinar: Rising Importance of Software TestingSauce Labs Webinar: Rising Importance of Software Testing
Sauce Labs Webinar: Rising Importance of Software Testing
 
BDD With Selenide by Hima Bindu Peteti
BDD With Selenide by Hima Bindu PetetiBDD With Selenide by Hima Bindu Peteti
BDD With Selenide by Hima Bindu Peteti
 
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
 
Continuous Delivery for "Mature" Codebases by Melisa Benua
Continuous Delivery for "Mature" Codebases by Melisa BenuaContinuous Delivery for "Mature" Codebases by Melisa Benua
Continuous Delivery for "Mature" Codebases by Melisa Benua
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

#SFSE: XPath Alternative for Browser Automation in IE

  • 1. XPath alternative for Browser Automation in IE
  • 2. Mridul Bansal Graduate Student, Software Engineering (Dec’11) San Jose State University Software QA Intern @Citrix, CA Software Test Development Intern @Hara, CA Software Test Engineer @Covelix, India http://www.linkedin.com/in/mridulbansal About Me
  • 3. Automation in IE using Webdriver!!! Problem Statement
  • 4.   n00b   Lot has already been said…   Take with a pinch of salt Caution!
  • 6.   Dynamic id   XPath   Handles XPath differently   Painfully Slow Why?
  • 7.   Increase timeout   CSS   Alternate locators Fix?
  • 8.   Nokogiri (Ruby) http://nokogiri.org/ gem install nokogiri require ‘nokogiri’ iFix
  • 9. Earlier @driver.find_element(:xpath => "//span[contains(., ABC')]").click Now src = "<div id=""treeForm:tree:childs"">#{@driver.page_source()}</ div>" curr_id = Nokogiri::HTML(src).xpath("//div[@id = 'treeForm:tree:childs']/div[1]/div[2]/table[11]").attribute("id") @driver.find_element(:id, curr_id).click How?
  • 10.   Test execution time on FF3.6 using Webdriver = 3:00   Test execution time on IE9 using Webdriver = 4:50 Benchmarks
  • 11.   HtmlCleaner - http://htmlcleaner.sourceforge.net/ Alternatives
  • 12.   http://nokogiri.org/   http://php.jglobal.com/blog/? tag=selenium   http://www.qaautomation.net/?p=216   http://blog.altom.ro/2010/10/selenium- xpath-and-internet-explorer.html References
  • 13.   Selenium Meetup   Hara   Huynh Kang Credits
  • 14. ©   2011   Hara   /   confi den0 Open House al  /   Page   14  
  • 15. Appreciate in Public, Criticize in private… Recommend on LinkedIn!  ©   2011   Hara   /   confi den0 My Takeaway! al  /   Page   15  
  • 16. Mridul Bansal Graduate Student, Software Engineering (Dec’11) San Jose State University Software QA Intern @Citrix, CA Software Test Development Intern @Hara, CA Software Test Engineer @Covelix, India http://www.linkedin.com/in/mridulbansal Thanks for bearing!!