Forum Discussion

brahmivelpur's avatar
7 years ago

Re: Test step for skipping others?

Am having one usecase  where i created test suite with 3  test steps inside that testcase .


1.teststep1--> loading properties file and creating testRunner Context.

2.Invoking Authtoken getting api ,setting the token from api response to context .

3.Using the token from context and making another  rest call.


  Now my challenge is Token is valid for 30mins .Currently when am executing test ,all 3 steps running in sequential everytime .when I try load test each time that  token getting step also getting called and my test results including that .Since the token is valid of 30mins ,how can i skip that step for 30 mins and run the other steps ? Appreciate your quick help on this .




1 Reply

  • nmrao's avatar
    Champion Level 3
    Not sure how this is going to help. But you may give it a try.

    Check for a condition before running the logic of auth token creation. Not sure what type of step you have there.

    What condition to check?
    Use a test case level property, say EXPIRE_TIME.
    Check if the value of EXPIRE_TIME is equal to current time or lesser.
    Property itself would not be present for the first time, so condition matches; run autho token creation logic.
    After token is created, set the EXPIRE_TIME at test case level property. This would be 30 future time.
    When test is repeated, it won't go into auth token creation logic because of the condition we have.

    Hope you can implement based on above algorithm.