Forum Discussion

KarelHusa's avatar
KarelHusa
Champion Level 1
2 months ago

How to change the API of a REST test step

 

 

Hi guys,

If you test REST APIs in SoapUI, you may encounter an issue where you cannot change the API attached to the REST test step.

Trying to change the API attached to the REST test step

I am not aware of any standard way to do it, so I prepared a simple Groovy script to change the test step's API programmatically:

testRunner.testCase.getTestStepList().each(){
	step = it
	service = step.getService()
	log.info("TestStep: ${step.getName()}")
	config = step.getRequestStepConfig() 
	log.info "Before: ${step.getService()}"
	config.setService("BankGround_v1.12")
	log.info "After: ${step.getService()}"
}

I thought this may help those of you who work with REST APIs, which get changed over time (new versions). 

For a longer story, you can visit the following article:

https://www.linkedin.com/pulse/soapui-what-rest-api-changes-karel-husa-7vb2e

 

No RepliesBe the first to reply