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

In Silk Test Classic when using MultiTestCase, can I set appstate none?

In Silk Test Classic when using MultiTestCase, can I set appstate none?

The multitestcase keyword is used to declare that a testcase will operate in a multi-application distributed environment.

A testcase keyword makes use of DefaultTestCaseEnter and DefaultTestCaseExit to recover a single application.

A test case defined with multitestcase keyword starts by automatically executing the DefaultMultiTestCaseEnter function and ends with the automatic execution of DefaultMultiTestCaseExit to handle recovery of multiple applications.

When using multi-application environment support you can pass the test case the names of the machines to be tested during that execution of the test case, but not the application state function. e.g. 

[-] multitestcase MyTest () appstate none is invalid syntax and will result in the compile time error "Only a testcase can define an appstate"

You can use the SetUpMachine() function to set application states within a multiTestCase() function as demonstrated below e.g.

[-] multitestcase MyMultiTest ()
[ ]
[ ] //We will specify null for the appstate parameter as we do not wish to set a specific state for the application under test. 

[ ] //Define variables to store names of the machines to execute the test on

[ ] STRING sMach1 = "myWin7VM"
[ ] STRING sMach2 = "MyWin8VM"

[ ] //The variables MyFirstApp and MySecondApp relate to the names of each applications window declared in the frame.inc file

[ ] SetupMachine (sMach1, MyFirstApp, null)
[ ] SetupMachine (sMach2, MySecondApp, null)
[ ]
[ ] //Run testcase Login()
[ ] Testcase login()


Within the frame.inc file declare the following at the top of the file:-


[-] MultiTestCaseExit (BOOLEAN bException)
[-] if (bException)
[ ] ExceptLog ()
[ ]
[ ] //SetMultiBaseStates ()
[ ] DisconnectAll ()

As the statement SetMultiBaseStates() is commented out, the default base state will not be executed for the test case and will result in behavior identical to appstate none.

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:
‎2014-10-31 21:22
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.