XXX Automation

[article]
Summary:

In this article, Dion Johnson takes a peek at an automation approach that isn't for the immature or the inexperienced. It is, however, for testers interesting in improving their scripting technique. But don't let the title fool you—you can use Dion's "XML, XPath, and Xcitement" approach in broad daylight.

For all you trench-coated, sunglasses-wearing test automators that have been searching the blogs in secrecy for some seedy scripting content, you've come to the right place. You have finally found the sensational, titillating information that is guaranteed to tickle your fancy and keep your minds sticky. That's right, I'm talking about some real XXX material: XML, XPath, and Xcitement!

XPath is a language used to navigate through elements and attributes in an XML document in an effort to find information that meets specific criteria. Thus, XPath is used to query for information in an XML document much like SQL is used to query for data in a database. This is a fun toy to have hidden away in your secret tester drawer for several reasons:

  • XML is stored in a text file, which not only simplifies data storage but also simplifies sharing information across incompatible platforms and porting to different platforms and tools.
  • XPath is used in various automated test tools, so increased XPath skills means increased skills in related test tools.
  • You can use XPath to produce various useful automation components.

The last item is particularly stimulating because the ability to produce automation components offers you a great release from many unwanted bounds. For example, as described in "XPath Marks the Spot" (Automated Software Testing Magazine, May 2009) XPath provides the ability to create your own object map feature. Therefore, if you are using an automated test tool that does not have an object map feature or that has an object map feature you don't like, you can create your own. In addition, you can create an automation environment variable file and other files for data storage and retrieval.

The secret to this seamy approach to enhancing your automation stamina lies in the three Xs:

  1. XML-You must understanding the structure of the XML file you are querying.
  2. XPath-You must understand basic XPath syntax.
  3. Xcitement-You must understand how your scripting or programming language implements the XPath syntax, so you can do the exciting work of putting your XPath prowess to work.

Truth be told, this approach is only seamy in perception. This is due to the fact that those who know how to use it, often keep the knowledge to themselves, while those that don't know how to use it, often shy away with the belief that the approach is too mature for the skill set they possess. If you have an open mind, however, this article will explore this seemingly dirty secret with you, allowing you to mature into a more adult automator.

About the author

Dion Johnson's picture Dion Johnson

As a senior test consultant and managing partner for DiJohn IC, Inc. and advisor to the Automated Testing Institute, Dion Johnson provides IT consulting services that focus on the overall system development lifecycle, with particular focus on the quality assurance, quality control, requirements analysis, and automated testing. He has presented at numerous SQE conferences and contributed to StickyMinds.com and Better Software magazine. In addition he is an editor for the Automated Software Testing magazine. Email Dion at dionjohnson@dijohn-ic.com or dionjohnson@automatedtestinginstitute.com.

AgileConnection is one of the growing communities of the TechWell network.

Featuring fresh, insightful stories, TechWell.com is the place to go for what is happening in software development and delivery.  Join the conversation now!

Upcoming Events

May 04
May 04
May 04
Jun 01