Forum Discussion

Usha_Kodali's avatar
Usha_Kodali
Frequent Contributor
15 years ago

teststep status for a particular step

how to get step status for a particular teststep using property expansion?
testRunner.getTestname().getTestStepbyName("testname").Status?
i want to use this in datasink

7 Replies

  • Usha_Kodali's avatar
    Usha_Kodali
    Frequent Contributor
    Hi,
    i tried testCase.getTestStepByName("name").Status.
    It says No such property :testCase for class:Script1
  • Usha_Kodali's avatar
    Usha_Kodali
    Frequent Contributor
    In the API i found that there is no Status() method for getTestStepbyName.
    We have to use run(testRunner, context).getStatus().

    It would be good if we have getStatus() method for getTestStepbyName.
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Usha,

    Have a look at http://www.eviware.com/blogs/oleblog/?p=442, the status is not part of the TestStep API since a TestStep can be executed multiple times during the execution of a TestCase and the status would thus only be the latest one..

    using run.. as you mention will execute the teststep again, maybe you don't want that?

    regards!

    /Ole
    eviware.com
  • Usha_Kodali's avatar
    Usha_Kodali
    Frequent Contributor
    yeah i dont want to execute the test step...i disabled my step and running through datasink run....
    can you tell me workaround?
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi!

    now I don't really understand how you are executing the teststep, but you have the following options to get the status;

    1) If the teststep is being executed as part of your testcase, you need to get the corresponding TestStepResult object from the testRunner.results array, this has a status property
    2) If the teststep is being executed "manually" by calling its run(..) method from a script, use the TestStepResult returned by that method instead..

    does that help? If not, please elaborate on your setup/requirements..

    regards!

    /Ole
    eviware.com