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.