First Steps with QTP

Matt:
So I’ve got around 10 years experience with Loadrunner, am well-versed with Winrunner, can code in half a dozen languages and still I never got around to learning QTP. Well now I have no choice since we’re using it at my latest client site.
The aim of this article is to provide guidance in QTP, how to start, what to look at, how to record a simple script and parameterise it. The essentials, basically.

I recorded a simple script going from Google to AS.org, inserted one checkpoint as I was doing so. It seems that the insertion of checkpoint is best done at record-time. I’m not clear yet on how to insert one afterwards…

My script looks like:
Browser("Google").Page("Google").WebEdit("q") _
.Set "automationsolutions.org"
Browser("Google").Page("Google").WebEdit("q").Submit
Browser("Google").Page("automationsolutions.org") _
.Link("Automation Solutions").Click
Browser("Google").Page("Automation Solutions").Check _
CheckPoint("Automation Solutions")

It’s very readable I suppose and handily is built around Visual Basic, one of the languages I am familiar with.

Standard stuff like Browser, Page, WebEdit, (“q”, by the way is the name of the textbox object on Google’s homepage. Check with Firebug if you want confirmation) Link and Click are container objects or Actions for specific data, but I don’t think “Google”, “Automation Solutions” or that CheckPoint tell me enough about what’s going on – is “Google” www.google.co.uk?, is “Automation Solutions” a link to the site or a string to be pushed to the browser? And what is that checkpoint checking for?

The Object Repository

Right-Clicking on the keyword “Google” brings up a menu with Object Properties uppermost in the list. Clicking on that brings up this:

!img_placeholder!

I’m not happy with the default properties and although QTP might feel they’re sufficient to identify the object, I want more information so I click the green +.
I can see URL is available for selection (as openurl) so I select that. It has no effect on the code, but in the event I need to debug, I can see how knowing the url could be useful.

!img_placeholder!

Right-clicking on the checkpoint brings up:

!img_placeholder!

It shows what text is being searched for, and it also shows that it can be parameterised. Having added it to the global table, I am forced to wonder how best to data-drive a QTP test.

Conclusion

Using google to search for a data string, find a link based on that string and then check that its on the page we expected might seem trivial but it’s allowed us to see the basics of QTP

First Steps with Selenium

Matt:
So, Selenium is an open-source toolset for testing web-based applications. It can be found here.
I started working with Selenium recently and I though it’d be an interesting post to document how I went from novice to competent user.

One of the interesting features of Selenium is that is can be used for performance testing. It’s my experience that performance testing is a costly business, so to see an open-source tool that can do it is rare.

Lets begin by looking at what Selenium is comprised of:

  • Selenium IDE – the scripting environment.
  • Selenium RC – allows further scripting and execution with variable data
  • Selenium Grid – Allows for multiple tests (or instances of the same test) to be executed.

It seems to me that the IDE and RC are doing the job of Loadrunners VUGen and Grid is handling the tasks of the controller. More on this in a future post.

At the time of writing, Selenium IDE is available as an add-on for the Firefox browser only, though the tests can be replayed (via RC) on Firefox, IE and Chrome.

Installation

Installation is made easy with the availability of 3 zipped packages (core, rc and grid) and the inclusion of the IDE as a firefox extension, (xpi) which will automatically install into firefox. The folks over at Selenium HQ also recommend getting an element inspector for your browser. As all the Selenium scripting I’ve done is in Firefox, Firebug is highly recommended, and freely available as an add-on or from http://getfirebug.com/ losartan medication.

Start by installing the IDE into firefox, and unpack the zip files somewhere sensible.

Hello Selenium!

Under the tools menu, there should now be an entry for Selenium IDE that leads us to this:

Selenium IDE

More to come, this article is going to be much bigger than I first thought…