Forum Discussion

mcbootus's avatar
mcbootus
Contributor
14 years ago

[Res] Calling test cases and test steps

Dear Support,

I want to setup a global groovy script which calls test steps from other test cases - below is an example structure:

TESTSUITE1
-----TESTCASE1
-------TESTSTEP6

-----TESTCASE2
--------TESTSTEP8

-----TESTCASE3
--------TESTSTEP2

TESTSUITE2
-----TESTCASE1
-------TESTSTEP3



I want to be able to call these scripts as follows:

Call TESTSUITE1 / TESTCASE1 / TESTSTEP6
Call TESTSUITE1 / TESTCASE2 / TESTSTEP8
Call TESTSUITE1 / TESTCASE3 / TESTSTEP2
Call TESTSUITE2 / TESTCASE1 / TESTSTEP3


I already use the command " testRunner.runTestStepByName("TESTSTEP1") " but this only works within the testcase - is it possible to call other testsuites / testcases / teststeps from a groovy script?


Thank you in advance,
Armen
  • Hi Armen,

    you can run a TestCase with

    runner = testRunner.runTestStep( project.testSuites['TestSuite1'].testCases['TestCase2'].run( null, true )
    runner.waitUntilFinished()
    etc..

    Does that work ok?

    regards,

    /Ole
    eviware.com