Reputation: 165
I want to keep my Web Service username and password separately from SOAP UI
Test XML file.
So, I save username and password as custom properties in external file called properties.xml
.
But the problem is that after I manually import the property values (defined on the project level) and save the test, the values are added to the test XML file distinctly.
So, anybody who will open the test XML file after me, will be able to read the username and password in my property values. Which I do not want.
Inside the test XML file it looks like this:
<con:name>USERNAME</con:name><con:value>!MYUSERNAMEVALUE</con:value></con:property><con:property><con:name>PASSWORD</con:name><con:value>!MYPASSWORD</con:value>
Can I use reference to my username and password through the external file properties.xml, while automatically running the test, but not show values in test XML?
I thought this configuration would work:
<con:name>USERN</con:name><con:value>${projectDir\properties#USERNAME}</con:value></con:property><con:property><con:name>PASSWORD</con:name><con:value>${projectDir\properties#PASSWORD}</con:value>
or this one:
<con:name>USERN</con:name><con:value>${projectDir\properties.xml#USERNAME}</con:value></con:property><con:property><con:name>PASSWORD</con:name><con:value>${projectDir\properties.xml#PASSWORD}</con:value>
But they are not resolving the property values correctly.
Upvotes: 2
Views: 436
Reputation: 2387
I don't think you can use external files that way. Either you add a groovy step that will extract the username and password from your file and then you make your webservice point to those recovered values,
Or, when using the testRunner (I guess you do so for automatically running the tests), you use the -P option that will set your values as Project custom properties. In that case, in your webService, you just have to point to those project properties. example.
in your web service, set your username as ${#Project#username} and your password as ${#Project#password} and when you launch the testRunner you add the following options:
-Pusername=myUserName and -Ppassword=myPassword
refer to testRunner command-line arguments
Upvotes: 1