Come let us explore together…

Posts tagged ‘WBEM Scripting’

TestComplete in 64-bit Machine


Objective :

My aim is to find whether a particular software is installed in the system…

Implementation :

I have a Windows XP machine and my initial code written in TestComplete is able to identify the software by traversing the registry key values.

Then a new scenario arises where I need to run the same function in different environment(Windows Server 2008 box)

Now as you guessed my script fails… 😦

As usual tried with many workaround(WMI, Accessing Control panel-Add or Remove programs) . But no help…

At last extracted the function out of TestComplete and ran it under WindowsScriptHost in the Server 2008.

Surprise !!! It ran and fetched the software details

At this point of time, if anyone guessed what will be the root cause – Congrats ; Others, please follow the post 🙂

My Question is why the script is able to fetch the result in WSH and not from TestComplete ?

I have taken to the AutomatedQA forum and got reply as – “TestComplete and Windows Script Host refer different branches of registry tree in Windows 2008 server“.

In 64-bit machines by default TestComplete refers 32-bit registry and WindowsScriptHost refer 64-bit registry.

The 64-bit machines has two locations for Uninstall branch,
(64-bit registry) :HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\
(32-bit registry) :HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\

To work with the same registry version, we need to use the “Storages.Registry” object in TestComplete that can work with both registry versions.

But Storages object in will not be supported inside “ScriptExtension” in TestComplete 7.2.

So universal solution to this problem is using “WBEM Scripting approach”

Want to explore more ? Follow the link :- http://david.gardiner.net.au/2007/03/listing-installed-applications-on-vista.html

There is always a saying : Stopping three feet from Gold

If you are tired looking for a solution to your problem, just think you are three feet from GOLD.

You will start again and definitely find the solution. 🙂

Hope there are 101 ways to Automate…

Regards,Giri Prasad