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

Recently uploaded (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
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
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
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
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
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...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 

#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!!