Forum Discussion

Jacob_Hassing's avatar
Jacob_Hassing
Contributor
16 years ago

basic setup teststeps

i have created a few steps that does stuff like verify preconditions and setup data, adn generate data needed in later steps.
i call this group of test steps in 90% of my testcases.
right now i have just copied the steps to the testcases whiich need it.
but this will be a nightmare to maintain, i will have to make changes in all the copies if needed.

Is there a smart way to go about this ? du you have recomendations ?


/Michael

3 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello!

    There is a "Run TestCase" step that you can use for this. You should move all the common teststeps into a separate testcase, then use the "Run TestCase" teststep to run them. For documentation on doing this, go here. Good luck!

    Regards,
    Dain
    eviware.com
  • yes that works fine for me.
    now a have an extra question.

    i have moved my common stuff to a testcase, can i then in a script in that testcase get the name of the calling testcase ?



    /Michael
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Michael,

    Unfortunately you can't for now. However you could pass this as a parameter to the target testcase, ie:

    1) define a "callingtestcasename" property in the target testcase
    2) add this as a parameter in the runtestcase teststep and set the value to "${=testCase.name}".

    I hope this helps you.

    Regards

    /Dragica
    eviware.com