How do I change password and Username on every call in a Test Case in SoapUI?
- 12 months ago
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.