Forum Discussion
EX
TestProject
::TestSuite1
-TestCase1
-Restreqstep1
-Restreqstep2
How to run Restreqstep2 from TestSuite1 tear down script, not whole TestCase1.
- PrathapR5 years agoFrequent Contributor
I have a REST Service(Logout), it has to execute after all test cases in that particular test suite. I can keep this step in any test case of that test suite, but it should execute only after all test cases.
FYI: I have only one test suite in that project, so it satisfy requirement if we run through test suite tear down.
I got test step by using getTestStepByName method, but after that I didn't see a way to run it.
I hope it answer your queries.
Thanks!
- nmrao5 years agoChampion Level 2
Thumb rule is each test case should be independent.
Isn't logout to be done for each test case?
For example if some one want to run a particular case, the steps should include both login and logout steps as well part of the test so that it would run independently?
Currently, this isn't the case, right?If don't want the login, and logout steps for each test case, then alternatively use events feature to run login before test case,, and logout after the test case.
- PrathapR5 years agoFrequent Contributor
Yes, you are 100% right, I did same, I will do same, If it's regular logout like an app logout. But in my current case, it's totally different, the thumb rule we have to break here, have to execute logout service after all test cases, so that going to be either test suite tear down or project.
Thanks!
Related Content
Recent Discussions
- 8 days ago
- 11 days ago