How do I change password and Username on every call in a Test Case in SoapUI?
The user ID and password I use for my automated testing and API work in Soap UI needs to change. Because I rely so heavily on Soap UI, I haven't change the password for far too long. As part of testing that change, I want to change the Username to something harder to predict as well as the password. I know the username and passwords are all stored in the XXX-soapui-project.xml file. I have the username in there 9,429 times. I don't want to change those one at a time.
I thought maybe a quick search and replace would do it, but that seems to break the project. I'm happy to test it on just one Test Case, or a copy of the whole Project. Does anyone know how I can do this without change every single Username and password?
Update: Yes, I created global properties to store a bunch of variables. I created a great big list in Excel and imported them. That didn't fix the fact that I had hundreds to change.
Then I created a new blank Project, and a new Test Suite, then I cloned over the latest and most complicated Test Case. I saved this, exited SoapUI, then used Notepad++ to do a replace.
I searched for (names changed to protect the innocent):
<con:username>OpsUser$109</con:username><con:password>73Marlin</con:password>
And replaced it with:
<con:username>${Uid109}</con:username><con:password>${UidPW}</con:password>
Where ${Uid109} is Global Property Uid109 which contains OpsUser$109 and ${UidPW} contains 73Marlin. I just changed one user id first, and then went back into SoapUI and checked the impacted steps worked. They did, so I exited SoapUI, loaded up the Project in Notepad++ and did the rest. I now have a 296 step Test Case running with the credentials from the Global Properties. Not sure why the search and replace was corrupting the Project, but doing search and replace with the larger block of text seems to be a winner.
From now on I just use Global Properties, still have tons of others to update but I can do them as needed.
Hopefully this might be useful to know for someone else.