Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

How do I script sCmdLine path in SilkTest to work dynamically for different builds/versions of an application where build/version number is constantly changing?

How do I script sCmdLine path in SilkTest to work dynamically for different builds/versions of an application where build/version number is constantly changing?

With regard to running an invoke function to work dynamically for different builds/versions of an application, an example of the sCmdLine path to invoke version 4.5.0.61 of a Java application is as follows:

const sCmdLine = "C:\WINDOWS\system32\javaw.exe -Xmx512m-Djava.security.policy=""C:\\ProgramFiles\\Firetide\\HotView\\4.5.0.61\\java.policy""-classpath ""C:\ProgramFiles\Firetide\HotView\4.5.0.61\activation.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\lib\AdventNetLogging.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\lib\AdventNetAgentUtilities.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\lib\AdventNetSnmp.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\lib\AdventNetSnmpAgent.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\lib\crimson.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\mrm.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\nmscl.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\nms_client.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\lib\AdventNetAgentRuntimeUtilities.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\mrm_gui.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\postgresql-8.3-603ft.jdbc3g.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\lib\jaxp.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\lib\xalan.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\mail.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\snmp_agent.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\nmscl_common.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\jfreechart-1.0.6.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\jcommon-1.0.10.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\rad_mgr.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\telnetd.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\wizard.jar;C:\ProgramFiles\Firetide\HotView\4.5.0.61\lax.jar;""com.zerog.lax.LAX ""C:/ProgramFiles/Firetide/HotView/4.5.0.61/HotView Pro4.5.0.61.lax"" ""C:/Documents andSettings/Ramya/Local Settings/Temp/laxB.tmp"""

When there is a new build/version number, we would like to have this updated without having to manually change every occurence of the build/version number.

You could specify a string variable to hold the build number

STRING sHVVerNumber = "4.5.0.61"


and then be able to have that number read into the sCmdLine path without having to change each occurence manually.

What I would then suggest is to amend the sCmdLine path to include the string variable as such:

const sCmdLine = "C:\WINDOWS\system32\javaw.exe -Xmx512m-Djava.security.policy=""C:\\ProgramFiles\\Firetide\\HotView\\{sHVVerNumber }\\java.policy""-classpath ""C:\ProgramFiles\Firetide\HotView\{sHVVerNumber }\activation.jar; etc.

We are replacing the 4.5.0.61 version number with the variable {sHVVerNumber }. We can then specify build/version which will update the sCmdLine path at runtime.


Old KB# 23562

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 19:36
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.