Calendar

September 2010
S M T W T F S
« Aug    
 1234
567891011
12131415161718
19202122232425
2627282930  

Categories

QuickTest Pro Asset Upgrade Tool for QualityCenter 10

My office has recently upgraded to QualityCenter 10, as several members of our team were having issues connecting to QC9 using Internet Explorer 8 with Windows XP SP3. This was as good a reason as ever to switch.

We have been automating our smoke test suite in QuickTest Pro 9.5 over the past year and have recently upgraded to QTP10. The integration of QTP10 to QC9 was seamless and we had experienced no issues executing older scripts in the newer version of the tool. Of course, once we edited an older script, it was upgraded to the latest version. This is understandable.

Once we upgraded to QC10, however, we started experiencing some trouble. All of our prior scripts had started to fail due to external script references not being found. Also, many scripts couldn’t find the associated object repository. This caused some minor panic in our team: potential lost work, hours of required rework, etc.

We next attempted to edit our scripts in order to debug and figure out what we would have to do to fix these issues. That’s when we saw this message:

QTP Upgrade Warning

This is the first time I had heard of the QuickTest Pro Asset Upgrade Tool for QualityCenter. After doing some research, it was determined that this tool was included on the QualityCenter 10 Installation DVD.

The purpose of this tool is to upgrade all QTP scripts currently in your QualityCenter project. You will need to login to your project as a project admin and this tool must run on a machine that has QuickTest Pro 10 installed. There is another important step that took me a bit to figure out, mainly because I failed to read the documentation.

Your local QuickTest Pro installation must have the folder pathing setup to find all external references your scripts may use. This includes paths (in and out of QC) for shared object repositories, function libraries, and other scripts. If this is not set up, the Asset Upgrade Tool will not be able to process your scripts. To set up your folder pathing, in QTP go to Tools –> Options –> Folders.

Executing the upgrade tool is very straightforward, but please read the documentation carefully. The general process is to login to your project, analyze your project, then upgrade your project. It presents a full report of the analysis and upgrade process for your review.  It is highly recommended that you make a backup of your project before your upgrade, as you never know what may happen. The upgrade process is done on an active project, which is different than many other QC upgrade tasks. That being said, ensure that no one is accessing the project while the upgrade is running.

Once we had everything set up correctly and processed the upgrade, we found that we were now able to open our older scripts to edit in QTP10. We were also able to execute the scripts without error.

Updating ActiveX Datagrids in QTP

In my recent testing efforts, I have comes across a desktop windows form (written in VB6) involving updating a data grid and then calculating another field’s value based on those updates. In order to achieve this functionality, the development staffs implemented two events (AfterColUpdate and LostFocus) that, when triggered, would fire off the calculation method.

None of this is obvious to the end user when testing, all they see is enter a number into the grid column and the total field automatically updates with the sum of all values in the column. Easy peasy.

I created my reusuable action in QuickTest Pro and record the entering of data, which yielded the following code:

VbWindow(“frmMain”).VbWindow(“frmChildWindow1″).VbWindow(“frmChildWindow2″).AcxTable(“PaymentGrid”).SelectCell 1,4

VbWindow(“frmMain”).VbWindow(“frmChildWindow1″).VbWindow(“frmChildWindow2″).AcxTable(“PaymentGrid”).SetCellData 1,4, “30.00″

Continue reading Updating ActiveX Datagrids in QTP

Using QTP to Connect to an Oracle Database with Instant Client

Using QTP to Connect to an Oracle Database with Instant Client

by Geoffrey Rodgers
Need a light-weight ODBC connection to an Oracle database for you QTP scripts? Oracle Instant Client is just the ticket, assuming you have Oracle version 10g for your database. Please read the information provided by Oracle to make sure Instant Client is right for your needs.
The Instant Client Driver

I’m not going to rewrite everything provided by Oracle, but I will quickly say (for those of you that did not click on the above link) that Instant Client is a very quick installation and contains less overhead than the full client software that was previously required to connect to an Oracle database using something other than the Microsoft ODBC for Oracle driver.
Instant Client Driver Setup:

Continue reading Using QTP to Connect to an Oracle Database with Instant Client

Accessing Methods of ActiveX Objects

I have been using QuickTest Pro for several years now and have just discovered a simple, but highly useful, feature. In dealing with ActiveX controls, there are many times when the ActiveX add-in for QTP just doesn’t full recognize an application object.

Using the ObjectSpy, you can select the object in question and see all the runtime properties and methods available for the object. For the longest time, I had been using the GetROProperty() method to retrieve the values of the properties. However, I’d not considered how to execute the methods of the objects, as I never needed to do that.

It turns out that you can access the methods, and properties, of the object with this simple code snippet:


VbWindow("frmWindow").ActiveX("testObject").Object.methodName()
VbWindow("frmWindow").ActiveX("testObject").Object.Property

Happy Testing!

Description Objects

When creating reusable actions in QuickTest Pro, there are times you may come across the need to dynamically access an object within your application that may or may not exist within your Object Repository. One approach to handling this opportunity is through the use of Description Objects.

I could spend a lot of time attempting to explain how to go about implementing description objects, but I have found that QTP’s help files do a good job explaining exactly what you need to do. To find what you are looking for, search for “Using Description Objects for Programmatic Descriptions” within the help file.

Continue reading Description Objects

QuickTest Pro – List of mic* Keywords

Here is a list of mic* keywords that can be used in QuickTest Pro. I do not have documentation for each of the keywords. I have posted these has a quick reference guide for myself, and others.

These codes will be useful when entering text into textboxes, manipulating datagrids, selecting items for comboboxes and listboxes. Some are useful as constants: micPass, micFail, and micInfo. Most are specific for keys on the keyboard.

Continue reading QuickTest Pro – List of mic* Keywords

QuickTest Pro 9.5 Object Recognition Issue

The other day I was diligently creating reusable actions for later use and writing code like nobody’s business. I have had my object repository set up for weeks and haven’t had any issues with it. I have recently upgraded to QTP 9.5 with updated Add-ins for Visual Basic, Web, and .NET.

The application I have been automating is a VB6 desktop client application. Normally, my Object Spy recognizes the main form as frmMain, the VbName property for the action. Well, for whatever reason, QTP just stopped recognizing the VbName properties of all the application objects, choosing such helpful designations as VbWindow and VbButton.

Scouring the internet forums and support sites, I have discovered that this has been a fairly common issue with no distinct resolution. I had tried several remedies and then, in frustration, decided to reinstall the QTP application.

Lo and behold, I had solved the Object Recognition issue. An inelegant solution, but a solution nonetheless.

Using External Libraries in QTP

I’ve found it necessary to create my own code libraries in QuickTest Pro to handle scenarios that aren’t generally covered by the typical QTP or VBScript APIs. This is a useful process for creating reusable functions that are accessible to your entire automation suite. Continue reading Using External Libraries in QTP

The Object Repository in QTP 9

The Software Inquisition has an article about the new Object Repository interface in QuickTest Pro 9. Since the company I work is about to migrate to this version of QTP, I figured I would read up on it a bit. This article does a good bit of explaining some new features (and added headaches), so I have a better clue what to look for in a few weeks. Continue reading The Object Repository in QTP 9

Concatenating Strings In QTP

Today’s tech post is in response to a surprising amount of queries asking how to concatenate strings in QuickTest Pro.

First, it is important to remember that QuickTest Pro scripts are written using VBScript. With that in mind, you can investigate many corners of the internet for sample code and examples of VBScript code. Using the simple Google query returns a host of good resources: VBScript Google Search.

Second, let’s tackle to concatenation issue. In order to concatenate, or add, strings together, you must use the + operator.

‘ Example
Dim strTemp
strTemp = “I am a ” + “little teapot.”
MsgBox(strTemp)
‘ Results: “I am a little teapot.”

This next example takes two variables and concatenates them.

‘ Example
Dim strResults
Dim strTemp1
Dim strTemp2
strTemp1 = “Who let the ”
strTemp2 = “dogs out?”
strResults = strTemp1 + strTemp2
MsgBox(strTemp)
‘ Results: “Who let the dogs out?”

Hopes this tidbit of information helps you out.