obaid_shirwani
10 years agoContributor
Executing test on a different domain.
I want to execute the test cases on a totally different domain. Suppose a part of my script goes like this:
function AddOneTrialReport()
{
//1. Name: Generate a new Unique report name using the current time stamp.
var CurrentTimeStamp = aqDateTime.Now();
var ReportName = "TestReport_"+aqConvert.DateTimeToFormatStr(CurrentTimeStamp,"%Y%m%d%H%M%S");
Log.Message(ReportName);
Aliases.browser.Page("http://staging01/myApp/AddReport.aspx", 0).Form("pageForm").Panel("colright").Panel("divContentsArea").Panel("ContentPlaceHolder1_reportPanel").Panel(0).Panel(0).Table(0).Cell(0, 1).Textbox("ContentPlaceHolder1_txtName").Text = ReportName;
}
Now I want to change this URL to http://staging02/myApp/AddReport.aspx
Is there any project's property from where I can change this domain. The test scripts will formulate 1000's of lines and modifying every place is not easy.
Creating Variables <as under> is one option but I dont think that is smart either.
function AddOneTrialReport()
{
//1. Name: Generate a new Unique report name using the current time stamp.
var CurrentTimeStamp = aqDateTime.Now();
var ReportName = "TestReport_"+aqConvert.DateTimeToFormatStr(CurrentTimeStamp,"%Y%m%d%H%M%S");
Log.Message(ReportName);
var addReport = Project.Variables.domain+Project.Variables.addReport;
//where variable domain holds http://staging01/myApp/
//where variable addreport holds AddReport.aspx
Aliases.browser.Page("addReport", 0).Form("pageForm").Panel("colright").Panel("divContentsArea").Panel("ContentPlaceHolder1_reportPanel").Panel(0).Panel(0).Table(0).Cell(0, 1).Textbox("ContentPlaceHolder1_txtName").Text = ReportName;
}
Please share if there is something else.
function AddOneTrialReport()
{
//1. Name: Generate a new Unique report name using the current time stamp.
var CurrentTimeStamp = aqDateTime.Now();
var ReportName = "TestReport_"+aqConvert.DateTimeToFormatStr(CurrentTimeStamp,"%Y%m%d%H%M%S");
Log.Message(ReportName);
Aliases.browser.Page("http://staging01/myApp/AddReport.aspx", 0).Form("pageForm").Panel("colright").Panel("divContentsArea").Panel("ContentPlaceHolder1_reportPanel").Panel(0).Panel(0).Table(0).Cell(0, 1).Textbox("ContentPlaceHolder1_txtName").Text = ReportName;
}
Now I want to change this URL to http://staging02/myApp/AddReport.aspx
Is there any project's property from where I can change this domain. The test scripts will formulate 1000's of lines and modifying every place is not easy.
Creating Variables <as under> is one option but I dont think that is smart either.
function AddOneTrialReport()
{
//1. Name: Generate a new Unique report name using the current time stamp.
var CurrentTimeStamp = aqDateTime.Now();
var ReportName = "TestReport_"+aqConvert.DateTimeToFormatStr(CurrentTimeStamp,"%Y%m%d%H%M%S");
Log.Message(ReportName);
var addReport = Project.Variables.domain+Project.Variables.addReport;
//where variable domain holds http://staging01/myApp/
//where variable addreport holds AddReport.aspx
Aliases.browser.Page("addReport", 0).Form("pageForm").Panel("colright").Panel("divContentsArea").Panel("ContentPlaceHolder1_reportPanel").Panel(0).Panel(0).Table(0).Cell(0, 1).Textbox("ContentPlaceHolder1_txtName").Text = ReportName;
}
Please share if there is something else.