Ask a Question

How to write property value in setup script for test Suite? SOLVED

SOLVED
shantha_mh
Occasional Contributor

How to write property value in setup script for test Suite? SOLVED

Hi,

This is one of the previously resolved issue for @CXin a frequent contributor. Please assist me in the similar kind of error I am encountered for the following script I have developed.

 

def projectProperty = testSuite.project.getPropertyValue("MyProp")

import com.eviware.soapui.support.types.StringToStringMap
import com.eviware.soapui.model.testsuite.TestPropertyListener

testCaseList = testSuite.getTestCases()
testCaseList.each
{
testCase = testSuite.getTestCaseByName(it.key)
wsdlTestSteps = testCase.getTestStepsOfType(com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep.class)
wsdlTestSteps.each
{
if (projectProperty == "IMP1A_Secured" )
{
it.getHttpRequest().setOutgoingWss("IMP1A")
it.testRequest.setSslKeystore("qa.hub.jks")
}
else
{
it.getHttpRequest().setOutgoingWss("")
it.testRequest.setSslKeystore("")
}
}
}

Thank You.

ShamuH
4 REPLIES 4
richie
Community Hero

Hey @shantha_mh,

Whats the question? I couldnt actually see what the issue is. Are you saying you have a working script and you want to edit it to do something else?
You also have import declarations mid script which ive never seen before. Normally import decs are defined at the top of the script to ensure theyre available throughout the script.

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

Hi,

 

It looks like you're trying to script the adding of authorisation to your test steps.  You can do this from the Environments UI and the authorisation is then applied to each step calling that endpoint.

 

I'm just curious why you might want to script when the core app does this very well already.

shantha_mh
Occasional Contributor

Hi,
Thank your for pointing this, I developed this script for the previous SoapUI Pro versions because to authenticate for Secured endpoints. But I got the answer for this. Thank you
ShamuH
shantha_mh
Occasional Contributor

Yes, this environment feature was not working in the previous versions so I created this script. Now it is perfectly working with environment UI. Thanks for your quick response and helped a lot.
ShamuH
cancel
Showing results for 
Search instead for 
Did you mean: