We are going to do Regression testing of application on various environment. We will record the script on one environment (server) base line the script and execute the same script on same application but the server will be different. I mean the URL of the application will change and all other contents will remain same.
Is this possible in QTP if yest the how?
Any body can u please suggest me some QTP material for newbee.
for the script that you have recorded in one environment, go to Test-settings-Environment-VariableType(select User Defined)
click on new.
Create the file(this will be an xml file)
the file will be something like this
<Value>(URL of the ENVIROMENT)</Value>
key in the url in the file.
Save it.(say as environment.xml)
select "load variables and values from external file"
select the path of the file environment.xml
go to the script.
put this line as the first line
Environment.LoadFromFile("C:\.......\environment.x ml") 'this file will set the server to test
you are all set.
when you want to change the server, just go to environment.xml and change the url
An alternative is create an environments variable as Adai suggests (I will use one called ENV), at the beginning of the script call an external function containing code like this:
' Open Browser
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = true
' Set Correct URL
Select Case Environment("ENV")
siteURL = "http://www.Test.UAT.COM"
siteURL = "http://www.Test.SYS.COM"
siteURL = "http://www.Test.DEV.COM"
' Navigate to app Homepage
IE.Navigate siteURL 'Open the appropriate URL