Ask a Question

Is it possible to parameterize the user credentials in the soapui free version ?

SOLVED
dan2014
Occasional Contributor

Is it possible to parameterize the user credentials in the soapui free version ?

Hi,

 

I am using the soapui free version. I need to run my tests with different credentials by giving different endpoints for dev and staging. Is it possible to parameterize this in the free version or we need to buy the pro version to achieve this?

 

Regards,

Daniel

10 REPLIES 10
rupert_anderson
Valued Contributor

Hi Daniel,

 

Yes, although the pro version does have the environment feature, this is very doable in the open source version, there are several effective ways to accomplish this.

 

One way is to use a Properties TestStep. These can be used to load properties from a simple text file as part of a TestCase e.g. a file containing:

 

environmentName=QA Environment
invoiceEndpoint=http://localhost:9001
userName=test
password=password

 

These properties can then be referenced eslewhere in the TestCase e.g. to set Request TestStep properties/value using property expansions e.g. like 

 

def environmentName = context.expand('${LoadProperties#environmentName}')

 

Note you can also supply the file name as a property that could be supplied as a project level property e.g. reference with ${#Project#propertiesFileName}

 

 

Also as a runtime parameter (-PpropertiesFileName=...) if running SoapUI from a runner script e.g. testrunner.sh. Note you could supply all your properties this way, there is also a -e enpoint parameter for the runner script.

 

See also http://www.soapui.org/scripting---properties/working-with-properties.html

 

Hope this gives you some ideas,

 

Cheers,

Rupert

 

Author of SoapUI Cookbook
dan2014
Occasional Contributor

Thank u so much Rupert 🙂

Hi Dan,

 

No problem, very happy to help! 🙂

Did this fix your problem?

 

Cheers,

Rupert

Author of SoapUI Cookbook
dan2014
Occasional Contributor

Hi Rupert,

 

Sorry for the delayed response. It fixed the problem 🙂

 

Best regards,

Daniel

Hi Daniel,

 

Thanks for letting me know, glad you're sorted, it also potentially helps others to know that the problem is solved and they can use the solution - if you're happy too please can you also mark the topic as solved?

 

Thanks,

Rup

Author of SoapUI Cookbook
dan2014
Occasional Contributor

I am not able to find the link to solve on this page. 

 

Regards,

Daniel

Hi, 

 

Come to think of it I have never submitted a post, only answered them! 🙂

 

Isn't it in the 'options' in the top right of each post?

 

Cheers,

Rup

Author of SoapUI Cookbook
dan2014
Occasional Contributor

Hi Rupert,

 

I dont see that option. Please see the attached snapshot of what i see.

 

Regards,

Daniel

dan2014
Occasional Contributor

I guess you meant 'Accept as Solution'. I have clicked it now 🙂

 

Regards,

Daniel

cancel
Showing results for 
Search instead for 
Did you mean: