cancel
Showing results for 
Search instead for 
Did you mean: 

Disable reststep via groovy

Highlighted
Occasional Contributor

Re: Disable reststep via groovy

Hi @nmrao 

Answers:

 

1. Quite complex to understand without the logic of the report generation script. - attached library suite xml, which generates report and has teststep pass/ fail status and where i would like to have logic to disable passed steps
2. Let us say, you have executed the tests, x tests passed and y tests failed. And assume test tool is restarted. How do you know the state of the tests? Just a scenario. -- library suite xml has logic to check step pass or fail.

if status.toString() == 'OK'.  so. before new test is restarted, I call this report generation script, which creates pass/fail report of steps for 1st iteration and when test will be reiterated with 2nd data, ideally report generation will again get executed and create pass/fail report for second iteration but for 2nd data. ( What i thinking to do, when report gets generated for 1st data and before test is restarted, disable all pass steps, so when test is restarted, it only runs for failed steps with 2nd set of data and report gets generated for those alone steps)
3. Isn't it ok to run all the tests again once you get some fixes in the application / APIs? - it's ok, but its not API failure, some failures are due to data being wrong. So, just want to make sure it's really not a API issue and it's data issue.
4. Each and every test case should be independent. The report Generation in a separate suite does not make sense. Re-organize it and remove it from a separate suite. Say, move it Tear-down script of project. - I have tear down script in project strucuture, which in turn calls library suite and report generation script inside of it.

 

Teardown script: 

testRunner.testCase.testSuite.project.testSuites["Library"].testCases["Reporting_Utility"].

testSteps["GenerateCSVReport"].run(testRunner, context);

Highlighted
Community Hero

Re: Disable reststep via groovy


@alpha123 wrote:

Hi @nmrao 

Answers:

 

1. Quite complex to understand without the logic of the report generation script. - attached library suite xml, which generates report and has teststep pass/ fail status and where i would like to have logic to disable passed steps
2. Let us say, you have executed the tests, x tests passed and y tests failed. And assume test tool is restarted. How do you know the state of the tests? Just a scenario. -- library suite xml has logic to check step pass or fail.

 

[Rao] the test step status would be lost. and it is not possible say pass or fail.

 

if status.toString() == 'OK'.  so. before new test is restarted, I call this report generation script, which creates pass/fail report of steps for 1st iteration and when test will be reiterated with 2nd data, ideally report generation will again get executed and create pass/fail report for second iteration but for 2nd data. ( What i thinking to do, when report gets generated for 1st data and before test is restarted, disable all pass steps, so when test is restarted, it only runs for failed steps with 2nd set of data and report gets generated for those alone steps)
3. Isn't it ok to run all the tests again once you get some fixes in the application / APIs? - it's ok, but its not API failure, some failures are due to data being wrong. So, just want to make sure it's really not a API issue and it's data issue.

 

[Rao] Fix data. No hurry to generate partial report . Does it really take long to fix data?


4. Each and every test case should be independent. The report Generation in a separate suite does not make sense. Re-organize it and remove it from a separate suite. Say, move it Tear-down script of project. - I have tear down script in project strucuture, which in turn calls library suite and report generation script inside of it.

 

[Rao] You dont need a separate suite to generate report, move the logic to Teardown script.

 

Teardown script: 

testRunner.testCase.testSuite.project.testSuites["Library"].testCases["Reporting_Utility"].

testSteps["GenerateCSVReport"].run(testRunner, context);


Replies in line above.



Regards,
Rao.
Highlighted
Community Leader

Re: Disable reststep via groovy

@alpha123 : It worked on my machine, when i done the mentioned changes.

Refer below image where i have done the changes.

image.PNG

 

Are you still getting the same error?

 


Click "Accept as Solution" if my answer has helped, and remember to give "kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal
Highlighted
Occasional Contributor

Re: Disable reststep via groovy

Hi @HimanshuTayal ,

yeah I placed it same way, you have done. still no luck. see attached image.

Highlighted
Community Leader

Re: Disable reststep via groovy

@alpha123 Please ping me directly i will try to resolve as it is working at my end.

 


Click "Accept as Solution" if my answer has helped, and remember to give "kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal
Highlighted
Occasional Contributor

Re: Disable reststep via groovy

Hi @HimanshuTayal ,

I see private message to you, is there any other way you mean to contact you directly?

thanks

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors