Tuesday, March 31, 2009

QTP scripts bulk update.

We were caught in an extremely awkward situation few days back (I wonder why we always run into such situations :) ) wherein we upgraded our HP Quality Center and HP QTP to 10.0 which is their recent release. QTP 10.0 scripts were also in QC.
Before the upgrade took place we were running on QTP 9.2. We had a common vbscript for each Test Case in QC which used to call reusable actions saved at different location in QC. We also had associated those reusable actions. But after upgrade all our efforts were drained and we were left in a jeopardy where we could not even move back to 9.2 as much work had been done on QC front after the upgrade. The upgrade was done on live system without even checking on test systems whether it works or not. Management was to be blamed for it. Anyways, after the upgrade this association was lost and i was roped in to clear the debris and bring back the whole system on track.
After doing some research i came up with this unique update technique to get all the scripts updated automatically. I looked in all files which get saved when we save a QTP script and found that the 'Script.mts' file holds the actual text displayed when we open any script. I thought of updating the RunAction statement in this text with LoadAndRunAction statement. The parameters required for this new statement were different than from previous one which led to introduction of additional line of code which would call a new function and a additional vbs function. Our probelm was resolved and we were back to routine execution but the issue gave me nightmares.
Step 1:
Step 2:
Step 3:
Step 4:
Step 5:

Thursday, March 26, 2009

Comparing two different Databases

This is a tiny tool which would come handy in case you need to compare two different tables/ databases on same or different servers. I came across this unique requirement when we had to come up with a small code which would return TRUE or FALSE based on equal or unequal tables. I googled a bit and cam eup with the following code.

The code takes input from xml file. stored at disk. The code also compares SQL table with Oracle Table which is normally not provided by most DB compare tools available for free.

Mail me in case you have any issues using the tool.
Following is the snippet of xml file: