+ All Categories
Home > Technology > #SFSE: XPath Alternative for Browser Automation in IE

#SFSE: XPath Alternative for Browser Automation in IE

Date post: 09-May-2015
Category:
Upload: sauce-labs
View: 1,576 times
Download: 0 times
Share this document with a friend
16
XPath alternative for Browser Automation in IE
Transcript
Page 1: #SFSE: XPath Alternative for Browser Automation in IE

XPath alternative for Browser Automation in IE

Page 2: #SFSE: XPath Alternative for Browser Automation in IE

About Me

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

Page 3: #SFSE: XPath Alternative for Browser Automation in IE

Problem Statement

Automation in IE using Webdriver!!!

Page 4: #SFSE: XPath Alternative for Browser Automation in IE

Caution!

  n00b

  Lot has already been said…

  Take with a pinch of salt

Page 5: #SFSE: XPath Alternative for Browser Automation in IE

Caution!

IE9

Page 6: #SFSE: XPath Alternative for Browser Automation in IE

Why?

 Dynamic id

 XPath

 Handles XPath differently

  Painfully Slow

Page 7: #SFSE: XPath Alternative for Browser Automation in IE

Fix?

  Increase timeout

 CSS

 Alternate locators

Page 8: #SFSE: XPath Alternative for Browser Automation in IE

iFix

 Nokogiri (Ruby) http://nokogiri.org/ gem install nokogiri require ‘nokogiri’

Page 9: #SFSE: XPath Alternative for Browser Automation in IE

How?

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

Page 10: #SFSE: XPath Alternative for Browser Automation in IE

Benchmarks

  Test execution time on FF3.6 using

Webdriver = 3:00

  Test execution time on IE9 using Webdriver = 4:50

Page 11: #SFSE: XPath Alternative for Browser Automation in IE

Alternatives

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

Page 12: #SFSE: XPath Alternative for Browser Automation in IE

References

  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

Page 13: #SFSE: XPath Alternative for Browser Automation in IE

Credits

 Selenium Meetup

 Hara

 Huynh Kang

Page 14: #SFSE: XPath Alternative for Browser Automation in IE

©  2011  Hara  

/  confiden0al  /  

Page  14  Open House

Page 15: #SFSE: XPath Alternative for Browser Automation in IE

Appreciate in Public, Criticize in private… Recommend on LinkedIn!

©  2011  Hara  

/  confiden0al  /  

Page  15  My Takeaway!

Page 16: #SFSE: XPath Alternative for Browser Automation in IE

Thanks for bearing!!

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


Recommended