How to know current TC version from script?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2010
03:38 PM
01-10-2010
03:38 PM
How to know current TC version from script?
I have been using TC for a few years, but I'm sure this question is appropriate to this forum.
I have a team working on a generalized script framework. The framework is used by several teams in different areas of the world, all testing the same application, but different versions of the app, and different business rules.
The framework is written in JScript. It contains many if tests to behave differently based on the app version or the locale. I want to move to the latest version of TC, but I don't want to force all my customers to move right away. Also I'd like to be able to run the framework on different versions of TC for troubleshooting if required.
So I want to be able to say something like
if (TC_Version < 7) {
DoItTheOldWay();
} else {
UseNewFeature();
}
Is there a global variable or an easy way to tell?
I thought of finding testcomplete.exe and looking at its app version. I also thought of having my own project suite variable. Is there a better way?
I have a team working on a generalized script framework. The framework is used by several teams in different areas of the world, all testing the same application, but different versions of the app, and different business rules.
The framework is written in JScript. It contains many if tests to behave differently based on the app version or the locale. I want to move to the latest version of TC, but I don't want to force all my customers to move right away. Also I'd like to be able to run the framework on different versions of TC for troubleshooting if required.
So I want to be able to say something like
if (TC_Version < 7) {
DoItTheOldWay();
} else {
UseNewFeature();
}
Is there a global variable or an easy way to tell?
I thought of finding testcomplete.exe and looking at its app version. I also thought of having my own project suite variable. Is there a better way?
2 REPLIES 2
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2010
09:15 PM
01-10-2010
09:15 PM
Hi Neil,
Use this code:
Sys.Process("TestComplete").FileVersionInfo.MajorPart;
//or
Sys.OleObject("TestComplete.TestCompleteApplication").Manager.ProductInfo.VersionMajor;
-----
Alexander
Customer Care Manager
Alexander
Customer Care Manager
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-11-2010
07:07 AM
01-11-2010
07:07 AM
Thanks Alex, works a treat.
For interest, here is the production code I'll use:
//TC7 Support...
var testProcess = Sys.WaitProcess("TestExecute", Glo_SpeedFactor * 500);
if (testProcess.Exists == false) {
testProcess = Sys.WaitProcess("TestComplete", Glo_SpeedFactor * 500);
}
Glo_TCVersion = testProcess.FileVersionInfo.MajorPart;
//...TC7 Support
For interest, here is the production code I'll use:
//TC7 Support...
var testProcess = Sys.WaitProcess("TestExecute", Glo_SpeedFactor * 500);
if (testProcess.Exists == false) {
testProcess = Sys.WaitProcess("TestComplete", Glo_SpeedFactor * 500);
}
Glo_TCVersion = testProcess.FileVersionInfo.MajorPart;
//...TC7 Support
