At run time i require the test suite name that triggered my test script. Is there any property or way to do it?
There is no single command to get the TestSuite name from testExec.
1. In the test suite, add a StartUp testcase. In that save the name of the TestSuite as a Global Variable using a Java step.
SharedModelMap smm = new SharedModelMap();
smm.put("smm_testSuiteName", "my_test_suite_name"); //save it globally
2. Now in the tests within test suite, fetch the testSuite name by adding a java Step
testExec.setStateValue("testSuiteName", smm.get("smm_testSuiteName")); // fetch the value and save it as property testSuiteName
In the above scenario, we need to have seperate startup test for every suite.
I am working on an scenario in which I have "N" Test Suites and a common startup test for all these test suites.
In this common startup test I want to have suite name based on which I need to run some logic.
Searched the API for testExec. No function to get test suite name.
Searched all parameters which can retrieved by testExec.getStateValue() - there is nothing by which you can get suite name
Best solution for your scenario which I can think of right now - Create a new StartUp test for each test suite where you save the test suite name. Then you call the common StartUp testcase which is used by all test suites in a subprocess within this new test. Pass the test suite name as an input parameter to the subprocess.
So this way you can initialize things specific to your testsuite as well as things which are required by all test suites.
Because of some dependencies I cant have my common startup test as part of subprocess.
Is their anyway we can have two startup tests for a Suite ?
I do not see an option to have multiple startup tests.
If you are not going to run the test suites in parallel mode, then the test which initializes the TestSuite name as the first test to be run in Sequential mode.
If you have to run it in parallel, then I am out of ideas
Yes Jayanth, I dont want to restrict test suite to run in Sequential mode always.
Not sure why it is becoming this much difficulty to have suite name in LISA :-(
Curious. Why cannot you run the startup test as subprocess? What is the dependency?
Retrieving data ...