The explosive popularity of virtualization and cloud computing has created a rich foundation for new and successful cyber attacks. Organizations are rapidly adopting the use of these technologies to save money and increase efficiency. With the advent of stricter compliance and regulatory laws significantly affecting industries, managing cyber risk to your organization is becoming more and more critical especially as new and emerging technologies are adopted and deployed.
In his session at the ...| By Andreas Grabner | Article Rating: |
|
| May 10, 2011 10:00 AM EDT | Reads: |
924 |
In the last week my task was to create stable functional tests for a new eCommerce application. We picked several use cases, e.g.: clicking through the different links, logging in, searching for products and actually buying a product. We needed functional tests that run on both Internet Explorer and Firefox. With these tests we want to make sure to automatically find any functional problems but also performance and architectural problems (e.g: too many JavaScript files on the site, too many exceptions on the server or too many database statements executed for a certain test scenario). We also want to find problems that happen on certain browsers – therefore the task of letting these tests run on the two major browsers.
Test Framework: Selenium WebDriver
As test framework I decided to pick Selenium WebDriver and downloaded the latest version. I really thought it is easier to write tests that work in a similar way on both browsers. I have several lessons learned
- When you write a script always test it immediately on both browsers
- Use a Page Object approach when developing your scripts. With that you keep the actual implementation separated from the test cases (you will see my test scripts later in this blog – will make more sense when you see it)
- Be aware of different behaviors of IE and FF
- Make sure your test code can deal with unexpected timings or error situations
What a test script should look like (slick and easy to understand)
Here is a screenshot of one of my test cases.
Common functionality in PageObjectBase
I put lots of helper methods in a base class that I called PageObjectBase. As WebDriver doesn’t provide functionality to wait for certain objects or for the page to be loaded (at least I haven’t found anything on that) I created my own waitFor methods to wait until certain objects are on the page. This allows me to verify whether my app made it to the next stage or not. Here is another screenshot of one of my helper methods. You see that I had to work around a certain limitation I came across in IE – seems like By.linkText doesn’t work – same is true for most of the other lookup methods in By. What worked well for me is By.xpath with the only limitation that certain methods such as contains() don’t work on Firefox. As you can see – lots of things to consider – not everything works the same way on every browser ![]()
Easy to switch Browsers
My test classes create the WebDriver runner. Here I also created a base class that – depending on a system property that I can set from my Ant script – instantiates the correct WebDriver Implementation (IE or FF). This base class also checks whether dynaTrace will be used to collect performance data. If that’s the case it creates a dynaTrace object that I can use to pass Test and Test Step Names to dynaTrace. This makes it easier to analyze performance data later on – more on this later in this blog.
Analyzing Tests across Test Runs
As recently blogged, dynaTrace offers Premium Extensions to our free dynaTrace Ajax Edition. These extensions allow us not only to collect performance data automatically from Internet Explorer or Firefox – it automatically analyzes certain key metrics per test case. Metrics can be the number of resources downloaded, the time spent in JavaScript, the number of Redirects or the number of Database Queries executed on the Application Server.
Identify Client Side Regressions across Builds
I have access to different builds. Against every build I run my Selenium Tests and then verify the Selenium Results (Succeeded, Failed, Errors) and the numbers I get from dynaTrace (#Roundtrips, Time in JS, #Database Statements, #Exceptions, …). With one particular build I still got all successful Selenium Test executions but got a notification from dynaTrace that some values were outside of the expected value range. The following screenshot shows some of these metrics that triggered an alert:
JavaScript errors, number of resources and number of server-side exceptions show a big spike starting with a certain build
A double click on one of the metrics of the build that has this changed behavior opens a Comparison View of this particular test case. It compares it with the previous test run where the numbers were ok:
The Timeline makes it easy to spot the difference visually. Seems we have many more network downloads and JavaScript executions
A Side-by-Side Comparison of the Network Requests is also automatically opened showing me the differences in downloaded network resources. It seems that a developer added a new version of jQuery including a long list of jQuery plugins.
When these libraries are really required we need to at least consider consolidating the jQuery library and using a minified version of these plugins
Now we know why we have so many more resources on the page. The best practice recommends that we merge all CSS and JavaScript files into a single file and deploy a minified version of it instead of deploying all these files individually. The JavaScript errors that were thrown were caused by incompatibility between the multiple versions of jQuery. So – even though the Selenium Test was still successful we have several problems with this build that we can now start to address.
Identify Server-Side Regressions across Builds
Even though more and more logic gets executed in the browser we still need to look at the application executed on the application server. The following screenshot shows another test case that shows a dramatic growth in database statements (from 1 to more than 9000). Looks like another regression.
The Drill Down to compare the results of the problematic build with the previous works in the same way. Double click the measure and we get to a comparison dashboard. This time we are interested in the database statements. Seems it is one statement that got called several thousand times.
When we want to know who executed these statements and why they weren’t executed in the build before, we can open the PurePath Comparison Dashlet. The PurePath represents the actual Transactional Trace that dynaTrace captured for every request of every Test Run. As we want to focus on this particular database statement we can drill from here to this comparison view and see where i’ts been called.
Comparing the same transaction in both builds. A code change caused the call of allJourneys as compared to getJourneyById
Analyzing Tests across Browsers
In the same way as comparing results across test runs or builds it is possible to compare tests against different browsers. It is interesting to see how apps are different in different browsers. But – it is also interesting to identify regressions on individual browsers and compare these results with the browser that doesn’t show the regressions. The following screenshot shows the comparison of browser metrics taken from the same test executed against Internet Explorer and Firefox. Seems that for IE we have 4 more resources that get downloaded:
From here we can go on in the same way as I showed above. Drill into the detailed comparison, e.g.: Timeline, Network, JavaScript or Server-Side execution and analyze the different behavior.
Want more?
Whether you use Selenium, WebDriver, QTP, Silk, dynaTrace, YSlow, PageSpeed or ShowSlow – I imagine you are interested in Testing and you want to automate things. Check out my recent articles such as those on Testing Web 2.0 Applications, Why you can't compare execution times across browsers or dynaTrace Ajax Premium.
Related reading:
- Why you can’t compare cross browser execution times of Selenium Tests // I am currently working on a blog where I...
- How to use your Selenium Tests for automated JavaScript/AJAX Performance Analysis With more than 3 million downloads, Selenium is the world’s...
- Performance and Architecture Validation with your existing Unit Tests Agile Development Practices have widely been adopted in R&D Organizations....
- Understanding Twitter’s Javascript in Multiple Browsers: How to Profile, Debug and Trace across Firefox and IE 6,7,8 Every time I meet-up with web developers, either through a...
- Testing and Optimizing Single Page Web 2.0/AJAX Applications – Why Best Practices alone don’t work any more // Testing and Optimizing of what I call “traditional” page-based...
Published May 10, 2011 Reads 924
Copyright © 2011 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
- Schipul - The Web Marketing Company Helps American Marketing Association, Dallas/Fort Worth Chapter Improve Their Web Presence
- Make Holiday Shopping a Breeze -- United Airlines Gives Tips on Turning Miles into Smiles
- Make Holiday Shopping a Breeze -- United Airlines Gives Tips on Turning Miles into Smiles
More Stories By Andreas Grabner
Andreas has over a decade of experience as an architect and developer, and currently works as a senior performance architect and technology strategist for dynaTrace Software, where he influences product strategy and works closely with customers in implementing performance management solutions across the application life cycle. He is a regular speaker at software conferences, writes for a number of technology publications, and blogs at http://blog.dynatrace.com
- Early Bird Registration Savings for Cloud Expo New York to Expire Friday
- My Two-Year-Old Daughter Sofia Facing Life-Long Disability in Syria
- My Abducted Two-Year-Old American Guest Worker Daughter in Syria
- State Department Photos of My Abducted Daughter Sofia in Syria
- dynaTrace AJAX Edition 3.0 Released
- A Bedtime Story for Sofia Who Remains Abducted in Syria
- The Cost of an Exception
- Premium AJAX Edition 3 Extensions
- Real-Life AJAX Troubleshooting Guide
- Endless Loop in JavaScript Makes Masters.com Site Unresponsive
- Application Performance & Architectural Problems You Can Find in an Hour
- Norman Encourages Periodic Patch Management to Defend Against Cyber Attacks
- Cloud9 IDE Launches PaaS for JavaScript and HTML5
- Behind the Scenes of Serialization in Java
- Why Go with RichFaces
- Development-as-a-Service Platform Cloud9 IDE
- Twitter Down, Arab Revolution on Hold
- Early Bird Registration Savings for Cloud Expo New York to Expire Friday
- Netbiscuits Extends Development Framework with HTML5+
- My Two-Year-Old Daughter Sofia Facing Life-Long Disability in Syria
- Be Standard, Be Free: Use JSR-303 for Validation
- My Abducted Two-Year-Old American Guest Worker Daughter in Syria
- State Department Photos of My Abducted Daughter Sofia in Syria
- dynaTrace AJAX Edition 3.0 Released
- Building a Drag-and-Drop Shopping Cart with AJAX
- What Is AJAX?
- Google Maps! AJAX-Style Web Development Using ASP.NET
- Flashback to January 2006: Exclusive SYS-CON.TV Interviews on "OpenAjax Alliance" Announcement
- How and Why AJAX, Not Java, Became the Favored Technology for Rich Internet Applications
- AJAXWorld Conference & Expo to Take Place October 2-4, 2006, at the Santa Clara Convention Center, California
- AJAX Sponsor Webcasts Are Now Available at AJAXWorld Website
- "Real-World AJAX" One-Day Seminar Arrives in Silicon Valley
- AJAXWorld University Announces AJAX Developer Bootcamp
- Where Are RIA Technologies Headed in 2008?
- AJAX Support In JadeLiquid WebRenderer v3.1
- Struts Validations Framework Using AJAX
The explosive popularity of virtualization and cloud computing has created a rich foundation for new and successful cyber attacks. Organizations are rapidly adopting the use of these technologies to save money and increase efficiency. With the advent of stricter compliance and regulatory laws significantly affecting industries, managing cyber risk to your organization is becoming more and more critical especially as new and emerging technologies are adopted and deployed.
In his session at the ...May. 14, 2011 11:00 AM EDT Reads: 893 |
By Pat Romanski Companies of all kinds are generating more data than ever before. In recent years, many have accumulated terabytes and even petabytes of transactions, messages, logs, documents and other kinds of data and now are seeking ways to extract, share and even monetize the critical-business insights hidden within it. But, conventional premises-based software technologies like relational databases and fat client analytics packages make it difficult for people in different companies and even different dep...May. 13, 2011 03:00 PM EDT Reads: 907 |
By Liz McMillan What does it take to successfully deploy and manage your enterprise cloud? If you don’t already have the answer, this session is for you! Fast-track your transformation to enterprise cloud by understanding how to: on-board existing applications, automatically provision complex multi-tier applications, monitor service levels, meter consumption, do all of the above and address a myriad of other issues even as your cloud grows.
In his session at the 8th International Cloud Expo, Madhup Gulati, Pr...May. 13, 2011 02:15 PM EDT Reads: 837 |
By Pat Romanski The North Shore LIJ Health System Story: The economy may be “officially” out of a recession, but organizations have learned that in the “new normal,” extreme volatility and uncertainty will persist. Making large capital investments without a fast return on investment is no longer an option, yet organizations have to accelerate the pace of innovation and become more agile and responsive, given the uncertainty. Companies are now looking to the private cloud to reduce their costs and give them the ...May. 13, 2011 01:00 PM EDT Reads: 791 |
By Elizabeth White PCI and HIPAA compliance have a significant and broad ranging impact on millions of U.S. companies. As businesses increasingly migrate their data to the public cloud, the issue of how to maintain compliance has become more important than ever.
In their session at the 8th International Cloud Expo, Jeff Uphues, VP of Sales and Marketing for Cbeyond Cloud Services, and Stacy Griggs, Senior Director of Customer Experience for Cbeyond Cloud Services, will unveil the primary obstacles companies face...May. 13, 2011 12:15 PM EDT Reads: 753 |
By Elizabeth White Putting a cloud integration and Enterprise Service Bus (ESB) strategy in play prepares enterprises for the next generation of flexible, distributed and scalable cloud-enabled business applications while facilitating greater operational efficiency, generating more revenue, and helping businesses enter new markets.
SOA provides a layer of abstraction over all existing architectures, allowing distributed solutions to be built by composing asynchronous services into composite applications over a n...May. 13, 2011 12:00 PM EDT Reads: 860 |














Companies of all kinds are generating more data than ever before. In recent years, many have accumulated terabytes and even petabytes of transactions, messages, logs, documents and other kinds of data and now are seeking ways to extract, share and even monetize the critical-business insights hidden within it. But, conventional premises-based software technologies like relational databases and fat client analytics packages make it difficult for people in different companies and even different dep...
What does it take to successfully deploy and manage your enterprise cloud? If you don’t already have the answer, this session is for you! Fast-track your transformation to enterprise cloud by understanding how to: on-board existing applications, automatically provision complex multi-tier applications, monitor service levels, meter consumption, do all of the above and address a myriad of other issues even as your cloud grows.
In his session at the 8th International Cloud Expo, Madhup Gulati, Pr...
The North Shore LIJ Health System Story: The economy may be “officially” out of a recession, but organizations have learned that in the “new normal,” extreme volatility and uncertainty will persist. Making large capital investments without a fast return on investment is no longer an option, yet organizations have to accelerate the pace of innovation and become more agile and responsive, given the uncertainty. Companies are now looking to the private cloud to reduce their costs and give them the ...
PCI and HIPAA compliance have a significant and broad ranging impact on millions of U.S. companies. As businesses increasingly migrate their data to the public cloud, the issue of how to maintain compliance has become more important than ever.
In their session at the 8th International Cloud Expo, Jeff Uphues, VP of Sales and Marketing for Cbeyond Cloud Services, and Stacy Griggs, Senior Director of Customer Experience for Cbeyond Cloud Services, will unveil the primary obstacles companies face...
Putting a cloud integration and Enterprise Service Bus (ESB) strategy in play prepares enterprises for the next generation of flexible, distributed and scalable cloud-enabled business applications while facilitating greater operational efficiency, generating more revenue, and helping businesses enter new markets.
SOA provides a layer of abstraction over all existing architectures, allowing distributed solutions to be built by composing asynchronous services into composite applications over a n...
One of my hobbies is modeling – mostly for wargaming but also for the sake of modeling. In an average year I do a lot of WWII models, some modern military, some civilian vehicles, figures from an array of historicalimage timeperiods and the occasional sci-fi figure for one of my sons… The oldest (24...
A recent power outage in the middle of the night reveals automation without context can be expensive for aquariums – and data centers.
You may recall from several posts (Cloud Chemistry 101, The Zero-Product Property of IT and The Number of the Counting Shall be Three (Rules of Thumb for Applicatio...
With Cloud Computing emerging on the scene as a solution to a number of computing use cases, it will drive modernization of your existing systems. Perhaps it's just a new interface for driving mobile access to corporate data or consolidating standalone servers into a Cloud for achieving greater util...
Ever since I first published here my tentative list of Top 50 Bloggers on Cloud Computing it became clear that an expansion would be needed before too long. Thanks to community feedback via my Twitter account (@jg21) here goes with an expanded roster, listed as before in alphabetical order since I a...
Cloud and security still take top billing in many discussions today, perhaps because of the nebulous nature of the topic. If we break down security concerns in a public cloud computing environment we can separate them into three distinct categories of risk – the infrastructure, the application, and ...
C12G/OpenNebula will participate in the panel about Cloud Computing Fostering Innovation of the workshop Towards a Cloud Computing Strategy for Europe: Matching Supply and Demand organized by the European Commission to help identify the main elements of a European Cloud Strategy. This panel will dis...





















