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:


Ajit said...

Nice Work. Your contribution is remarkable.

mary Brown said...

Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a .Net developer learn from Dot Net Online Training from India. or learn thru ASP.NET Essential Training Online . Nowadays Dot Net has tons of job opportunities on various vertical industry.
JavaScript Online Training from India