Tuesday, 5 March 2013

Automated Testing with TestComplete: Checking whether System under Test is running on a 32 or 64-bit Operating System



When automated testing under different versions of operating systems, sometimes you want to perform different actions depending on whether you are running on a 32 or 64-bit operating system.

For example, a file may be installed in one directory on a 32-bit system and a different directory on a 64-bit system (as is commonly the case in Microsoft Windows 7 with the “Program Files (x86)” and “Program Files” directories), and part of your testing may be to test that an installer has correctly deployed certain files into the correct directory.

With the TestComplete automated testing software, you can run a JScript routine using the in-built ‘Sys.OSInfo’ property to perform different actions depending on the operating system.

To give an example of how this might be used, the basic JScript function below checks whether the operating system is 32 or 64-bit, obtain a different directory depending on the result and posts the results to the test log:



Of course, this can be extended to be as complex as you like, but it does demonstrate the possibility of what can be achieved with this useful in-built system property.

Written bySam Massey, Senior QA and Support Analyst, DSCallards
Visit:  www.dscallards.com 

No comments:

Post a Comment