I have lot of automated scripts opening the same URL (test environment). If I want to run the same scripts on a different URL (development environment) is there anyway I can change all of them at once instead of going to Record and Run settings option for each of the script and change the address manually?
There could be many ways depending on your scripting approach.
Here is one
Create a function OpenApp(sURL) and define a constant in library file as URL. Include library and call the function. You can change URL constant and run same script on different environment URL.
1. Define a Test Parameter so you can set a test environment code, e.g. "ACC", "UAT", "PRD"
2. Write a function to map the code to specific url
Function GetURL (byVal strEnv)
Select Case strEnv
GetURL = "http://www.xxx1.com/xxx"
GetURL = "http://www.xxx2.com/xxx"
GetURL = "http://www.xxx3.com/xxx"
3. Use Browser.Navigate to go to the url
4. Change all your calling code to GetURL("XXX") than a hard coded url.
5. You may want to open browser by yourself when starting the test by:
** Record and Run setting -> Run any open browser
** SysUtil.Run "c:\Program Files\...\iexplore.exe", GetURL("XXX")
Yeah Mark you did answer it in HP forum. I posted it here first but no one replied so I had to post it in HP forum.
I was able to create a reusable action to open IE and the URL and I'm calling it on each of the scripts. This way I can just go into that reusable action and change the url to development when needed, instead of going to all the scripts and changing the url on each of them under record and run setting.