Forum Discussion
The RawRequest is a test step property, thus accessed via getProperty method. Try something like this:
projectRunner.getResults().each(){ testSuiteRunner -> 
	testSuiteRunner.getResults().each() { testCaseRunner ->
		
	 	testCaseRunner.getResults().each() { testStepResult ->
	 	
	 			// Make sure that the test step has properties (not sure if there are any that don't but just being safe).
				if(testStepResult.getTestStep() in com.eviware.soapui.model.TestPropertyHolder){
					log.info('Test step "' + testStepResult.getTestStep().getName() + '" has properties.') 
					// Make sure the test step has a RawRequest property before trying to read it.
					if(testStepResult.getTestStep().hasProperty('RawRequest')){
						log.info('Test step "' + testStepResult.getTestStep().getName() + '" has a RawRequest property.') 
						log.info(testStepResult.getTestStep().getPropertyValue('RawRequest'))
				}
			}
		}
	}
}
Regarding the query about parametrised values, the documentation for the rest request test step states:
- RawRequest - Binary request data. The same content you can see in the Raw view of the request editor without headers. Property expansions are converted to expected values.
 - Request - Request data with unconverted property expansions.
 
If you find your experience is different to this I would log a support call with SmartBear.
- ripplegupta9 years agoContributor
Thanks Radford,
I will check and get back here with confirmation , thanks for your information.
 - ripplegupta9 years agoContributor
Hi thanks Radford, i was able to get raw request with property expansion.
but properties like query, header and template are not giving data after property expanison, can you help here ?
- Radford9 years agoSuper Contributor
Sorry, never had to do this myself I don't think I can really help further. Try looking at the JavaDocs for the Classes:
They may be of some help to you, it's probably where I would start investigating.
Please post back here if you find a solution.
- ripplegupta9 years agoContributor
Thanks Radford. I was able to solve my last query.
Actually i was looking for exact request posted to server for test steps so i looked into junit report collector class which generates report files in xml format having everything. so i used that method which writes to file (i had to create print writer of type string writer to generate string instead of file though)
pw = new PrintWriter( stringWriter ) testStepResult.writeTo( pw )
Hope this helps.