cancel
Showing results for 
Search instead for 
Did you mean: 

Run TestCase test step

SOLVED
Highlighted
New Contributor

Run TestCase test step

The test Case “PUT /api/v1/cases/case” has a test step “Run Delete CaseFile” and it passes in a value for caseFileId.

The target test Case “Delete CaseFile” has a custom property called “caseFileId” and the test step “CaseFile_DeleteCase-Request 1”  and accepts  ${#TestCase#caseFileId} from the calling TC (in this instance it’s the PUT TC”.

 

The above process works fine.

 

So my question is can this be structured so that a value for CaseFileId can be passed in (like above) OR if no value is passed the called/target TC “Delete CaseFile” simply use a default value for that field?

We want to be able to optionally pass in a value or have the TC use a default if no value is passed.

 

if this can't be done via the Run TestCase test step is there another way in SOAPUI to accomplish this?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

This is how it can be achieved: Have the default value set in the setup script of the template test case. For eg: ROLE is the custom property in template test case. And it is disabled as we dont want it to be executed as test case any time, just needs to invoked with different data as shown here with different values.

 

Selection_099.png



Regards,
Rao.

View solution in original post

4 REPLIES 4
Highlighted
Community Hero

Hey @battagliajj

I cant think of a way of using the native functionality to do what you need (some of the other forum members might have a spiffy idea though).
Im not a scripter (some of the other lads in here might be able to help) but the scenario doesnt sound like it would be overly difficult to do it with an if/else bit of groovy.....something on the lines of you extract the attribute ${#RESTStepResponse#caseFileId} to ${#Properties#caseFileId}, then write ${#Properties#caseFileId} to ${#TestCase#caseFileId} if ${#Properties#caseFileId} != null, else write your default value ${#Properties#caseFileIdDefault} to ${#TestCase#caseFileId} or something like that.
As i say, im not a scripter but it looks like what you need is a simple if/else decision so seems like it would be pretty straightforward.

Ta

Rich
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
Highlighted
Community Hero

Which type of test steps are accessing the custom property ?


Regards,
Rao.
Highlighted
Community Hero

This is how it can be achieved: Have the default value set in the setup script of the template test case. For eg: ROLE is the custom property in template test case. And it is disabled as we dont want it to be executed as test case any time, just needs to invoked with different data as shown here with different values.

 

Selection_099.png



Regards,
Rao.

View solution in original post

Highlighted
Community Manager

Thank you Community HeroesSmiley Happy

 

@battagliajj , please let us know if the suggestions worked for you. Thanks.


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
New Here?
Join us and watch the welcome video:
Announcements
TechCorner Leaderboard
Want a fun and easy way to learn ReadyAPI and show off your skills? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get a full Raw JMS request

Participate!

Compare an expected JSON value and actual response in Events

Participate!

Fetch value/data from JSON response using Groovy Script

See replies!

Get data from Petstore and add it to Excel sheets

Participate!
Top Kudoed Authors