cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to set a tag programmatically ?

SOLVED
Frequent Contributor

Is it possible to set a tag programmatically ?

Hello,

I have defined tags for my tests, and I would like to know if it is possible to set them programmatically.

The aim of that would be to tag wit ERROR the tests that fail, in order to be able to play only the tests with this tag on the next run.

 

thank you for any help

 

Alexandre

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Contributor

Re: Is it possible to set a tag programmatically ?

Well, finally I was not looking properly enough (wrong version of apis), the solution is in the online documentation https://support.smartbear.com/readyapi/apidocs/soapui/com/eviware/soapui/impl/wsdl/testcase/WsdlTest...

Here are the useful APIs, such as assignTag() and removeTag() that fulfill my needs.

 

Sorry that I was not clear enough in describing my purpose

 

Thanks for your help @nmrao

 

5 REPLIES 5
Community Hero

Re: Is it possible to set a tag programmatically ?

More details with example will help.


Regards,
Rao.
Frequent Contributor

Re: Is it possible to set a tag programmatically ?

Well, for instance I have manually declared a tag "ERROR" at project level.

At the end of each test, in my teardown script I have a small processing to display the test result and I would like, depending on the test result, to set or unset this ERROR tag. This, in order to launch the next run with the tag ERROR and replay only the failing test cases.

So far, in my teardown script, I can get the tag id (with getTagId("ERROR")) and I can check if it is assigned to the current test (isTagAssigned), what I would like to do is :

- if the test fails, set the ERROR tag to the current test

- if the test passes and the tag ERROR is set, unset this tag

 

do you think it is possible with groovy ?

 

thanks

Community Hero

Re: Is it possible to set a tag programmatically ?

All you are trying to do is to find the test cases error out?


Regards,
Rao.
Frequent Contributor

Re: Is it possible to set a tag programmatically ?

I know how to find them, but I'd like to apply my "ERROR" tag on those tests dynamically with groovy.

but there is no 'setTagId' method available as far as I know.

I think I can't handle it with custom property as I call testRunner through a TFS build and I gets sources at each run, this would imply to commit the project with the execution status, which cannot be done dynamically.

Maybe I can store test's status in a separate file and use it for running tests in error only ...

Highlighted
Frequent Contributor

Re: Is it possible to set a tag programmatically ?

Well, finally I was not looking properly enough (wrong version of apis), the solution is in the online documentation https://support.smartbear.com/readyapi/apidocs/soapui/com/eviware/soapui/impl/wsdl/testcase/WsdlTest...

Here are the useful APIs, such as assignTag() and removeTag() that fulfill my needs.

 

Sorry that I was not clear enough in describing my purpose

 

Thanks for your help @nmrao

 

New Here?
Join us and watch the welcome video:
Watch the New Interview
APITestingMistake#2
Top Kudoed Authors