Forum Discussion
Also the below code I am running locally in different browsers. The script run all the browsers one by one installed on the machine. Do we need to make any changes in the code ?
var BrowserConfig = require("BrowserConfig");
var GeneralFuncs = require("GeneralFuncs");
var LoginCredentials = require("LoginCredentials");
function testCrossBrowser()
{
var url = "https://taxforms.app.texastech.edu/";
var logoutbtn = Aliases.browser.pageTtusTaxForms.panelTopNav.buttonLogout;
var titlePage = Aliases.browser.pageTtusTaxForms.panelTopNav.textnode1098tTaxForms;
var signInPageTitle = Aliases.browser.pageEraiderWebSignIn.textEraiderSignIn;
for(var i = 0; i < Browsers.Count; i++){
BrowserConfig.killProcess("iexplore");
BrowserConfig.killProcess("firefox");
BrowserConfig.killProcess("chrome");
browser = Browsers.Item(i);
Log.Message("Browser " + aqConvert.IntToStr(i) + " : " + browser.Description);
browser.Run(url);
LoginCredentials.basicAuthentication();
GeneralFuncs.CheckTitlePage(Aliases.browser.pageTtusTaxForms.panelTopNav.textnode1098tTaxForms);
aqUtils.Delay(5000);
LoginCredentials.LogOut(logoutbtn);
GeneralFuncs.CheckTitlePage(signInPageTitle);
aqUtils.Delay(2000);
Aliases.browser.Close();
}
BrowserConfig.killProcess("iexplore");
BrowserConfig.killProcess("firefox");
BrowserConfig.killProcess("chrome");
}
//Kill the browser process
function killProcess(PName)
{
killProcess = 0;
var p = Sys.WaitProcess(PName, 5000, 1);
while(p.Exists){
killProcess = killProcess + 1;
p.Terminate();
while(p.Exists){
Sys.Delay(50);
}
p = Sys.WaitProcess(PName,5000,1);
}
Log.Message("Process terminated");
}
The EnvironmentManager functionality determines the browser.... so, your browser loops would not apply. You would need to write your automation in such a way to use whatever browser opens in the designated test environment.