cancel
Showing results for 
Search instead for 
Did you mean: 

Disable reststep via groovy

Highlighted
Community Hero

Re: Disable reststep via groovy

Can't even see the image clearly.
Requested for a sample project which helps to reproduce the problem.


Regards,
Rao.
Highlighted
Occasional Contributor

Re: Disable reststep via groovy

Hi @nmrao,

 

you mean attach my project xml or any other sample project? 

Thanks

Highlighted
Community Leader

Re: Disable reststep via groovy

@alpha123 :

 

Just a sample project, delete your organisations data and share the dummy project or share the library suite.

 


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal
Highlighted
Occasional Contributor

Re: Disable reststep via groovy

Ok, I have attached Library suite, where I am generating report and trying to disable passed steps for finished iteration.

Highlighted
Community Hero

Re: Disable reststep via groovy

I don't want you to attach your project. But a sample project (probably with some mocking) to reproduce the issue.
And steps to see the issue.


Regards,
Rao.
Highlighted
Community Leader

Re: Disable reststep via groovy

@alpha123 : Thank you for sharing the file. My finds are as below

 

testStepToDisable = testRunner.testCase.getTestStepByName(testStepName)
if( status.toString() == 'OK'  ){
	testStepToDisable.disabled = true
	Thread.sleep(1000)
}

Change your code at the end by this code and it will work fine.

 


Click "Accept as Solution" if my answer has helped,
Remember to give "Kudos" 🙂 ↓↓↓↓↓



Thanks and Regards,
Himanshu Tayal
Highlighted
Occasional Contributor

Re: Disable reststep via groovy

It's still same error with solution provided by @HimanshuTayal .

 

I can't upload my project and i don't know how to create mocking of project yet @nmrao.

 

Any other way possible for you to reproduce?

 

thank you both for looking in to this.

 

 

Community Hero

Re: Disable reststep via groovy

Never asked to upload your project. It would be useful to no one.

Unless the problem is not sure, unlikely to find out a solution.

All I can say is you are using it incorrectly.

We don't know why you are disabling, enabling.

The project should be runnable automatically without manual intervention. As you send to execute the tests here and there.


Regards,
Rao.
Highlighted
Occasional Contributor

Re: Disable reststep via groovy

Hi @nmrao , not sure if you had a chance to go through below explanation of my project and why I am disabling it. Here it is again. also attached pic again, let me know if you can see it now.

 

Testsuite - 1) UST1  2) Library

 

Testsuite # 1 - UST1

has two tcs inside 

Tc # 1 - UST1(disabled) - this is where all my test steps are and what gets executed evertytime, it's disabled. Steps inside are executed with "ReadInput" step in Tc # 2 - DataLoop.

Tc # 2 iterates n times and executed steps from Tc # 1 with different data. ( My goal is to only run failed step in next iteration, hence looking in to solution to disable pass steps)

 

Testsuite # 2 - Library

GenerateCSVReport - this is report generation step for testsuite # 1, I am generating teststep pass/fail report for every iteration for Tc # 1 in Testsuite # 1. 

I am adding step disable logic in here, while writing it to report, if step passes in iteration 1, disable along with report generation and that's where i get this error. ( see in red in log section)

Highlighted
Community Hero

Re: Disable reststep via groovy

1. Quite complex to understand without the logic of the report generation script.
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.
3. Isn't it ok to run all the tests again once you get some fixes in the application / APIs?
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.


Regards,
Rao.
New Here?
Join us and watch the welcome video:
Top Kudoed Authors