Selenium XPath Performance Problems in IE

13
Selenium XPath Performance Problems In Internet Explorer Frank Cohen, CEO, (408) 871-0122, [email protected] March 18, 2009 The Server Side Symposium 2009

description

Selenium XPath Performance Problems in Microsoft Internet Explorer (MS IE). Shows why a Selenium script that runs in 3 minutes in Firefox takes 30 minutes to run in IE. And, what to do to mitigate this performance problem.

Transcript of Selenium XPath Performance Problems in IE

Page 1: Selenium XPath Performance Problems in IE

Selenium XPath Performance Problems In Internet Explorer

Frank Cohen, CEO, (408) 871-0122, [email protected] 18, 2009

The Server Side Symposium 2009

Page 2: Selenium XPath Performance Problems in IE

Open Source Test Automation

About PushToTest‣Our Mission: Test, To Make A More Reliable World

‣Make It Easier To Move From Manual To Automated Testing

‣Support Advanced Testing, including Agile, Load, Integration

‣Open Source Testing (OST) For Everyone

2

Page 3: Selenium XPath Performance Problems in IE

Next let’s talk about

Open Source Test Automation

Performance Anxiety

‣The Perfect Storm: IE 7, Selenium, Appcelerator

‣Mitigation

3

Research Prepared ByLuis Carlos Lara, [email protected] Martinez, [email protected]

Page 4: Selenium XPath Performance Problems in IE

Open Source Test Automation

The Problem

4

Ajax App, Selenium RC, TestMaker, Firefox 3

Ajax App, Selenium RC, TestMaker, Internet Explorer 7

30 s30 m

Page 5: Selenium XPath Performance Problems in IE

Open Source Test Automation

How Bad?

5

‣The IE 7 JavaScript engine runs up 8-times slower than Firefox 3

‣Appcelerator’s page compiler does not appear to be optimized for IE 7 performance.

‣We observed 30% performance difference in the way Appcelerator runs text fields between IE 7 and Firefox 3.

‣Some commonly used Selenium functions are not optimized for performance.

‣We observed a 1798% performance difference by using different Selenium element locator techniques.

Page 6: Selenium XPath Performance Problems in IE

Open Source Test Automation

Test 1: No JavaScript

6

‣Simple (almost no JavaScript) page (Google)

‣The total results of the tests were similar. 3800 ms for Firefox and 4000 ms for IE.

Page 7: Selenium XPath Performance Problems in IE

Open Source Test Automation

Caching Impact‣Firefox Caches JavaScript Objects

‣Repeat for 1 Minute:

‣Plus IE7/Selenium Exceptions (8 times): Permission Denied

7

Page 8: Selenium XPath Performance Problems in IE

Open Source Test Automation

Test 2: Ajax Application‣Javascript heavy site

‣Appcelerator’s Calendar sample that ships with PushToTest TestMaker 5.2.3

8

Page 9: Selenium XPath Performance Problems in IE

Open Source Test Automation

Resource Utilization

9

Firefox 3 IE 7

Page 10: Selenium XPath Performance Problems in IE

Open Source Test Automation

‣Selenium Type Command using various element locator functions

‣This may be because of:

‣Slow JavaScript engine in IE.

‣Selenium not optimized for IE.

‣Slow xpath system engine (if any) in IE.

Element Locator

10

Page 11: Selenium XPath Performance Problems in IE

Open Source Test Automation

DOM API Performance‣DOM Performance on IE 7

‣Dom Index is 6250 ms to 6750 ms in Link locator.

11

Page 12: Selenium XPath Performance Problems in IE

Open Source Test Automation

Mitigation

12

‣Run functional tests in Selenium RC with IE 7 and expect very long functional test times.

‣The test will complete eventually.

‣Do not compare the performance to the same test running on other browsers.

‣Run functional tests using HTMLUnit with an Internet Explorer profile.

‣Simulates IE functionality while using the faster Rhino JavaScript engine provided in HTMLUnit.

‣Details on PushToTest support for Selenium are found at http://selenium.pushtotest.com.

Page 13: Selenium XPath Performance Problems in IE

Open Source Test Automation

Where To Go From Here‣Watch A Screencast and Tutorial

‣http://www.pushtotest.com/screencastcentral

‣Attend An Open Source Test Workshop

‣http://workshop.pushtotest.com

‣Ask For A Proposal on Licenses, Training, Support, Consulting

‣Call +01 408 871 0122, [email protected]

13