You can use something similar to this, and adjust it to your own needs
function Start_Browser(site)
{
var espera;
var AW;
var app;
// configuracao projecto
Options.Run.Delay=1000;
Options.Run.Timeout=30000;
espera = 500;
aqUtils.Delay(espera, "Starting browser...");
if(aqString.Compare(Project.Variables.browser,"chrome",false)==0)
{
mataChrome();
//AW = Browsers.Item("chrome").Run();
AW = Sys.Browser("chrome");
AW.Page("*").Wait(-1);
}
else
if(aqString.Compare(Project.Variables.browser,"firefox",false)==0)
{
mataFirefox();
AW = Sys.Browser("firefox");
AW.Page("*").Wait(-1);
}
else
if(aqString.Compare(Project.Variables.browser,"iexplore",false)==0)
{
mataIE();
AW = Sys.Browser(Project.Variables.browser);
AW.Page("*").Wait(-1);
}
AW.Page("*").ToUrl("
http://www.google.com/");Delay(1000);
Log.Picture(Sys.Desktop.Picture(), "[+] SCREENSHOT");
Delay(1500);
Delay(1000,"Waiting for page");
}
function login(profissional, password, site)
{
Start_Browser(site);
//Project.Variables.browser = "iexplore";
var path_formulario = Sys.Browser(Project.Variables.browser).Page("*").Panel("content").Panel("auth_keyb").Form("keybform");
var path_username = path_formulario.Panel(0).Textbox("j_username");
var path_password = path_formulario.Panel(1).PasswordBox("j_password");
var path_botao = path_formulario.Panel(2).ImageButton(0);
path_username.WaitProperty("VisibleOnScreen", true, 3000);
path_username.SetText(profissional);
path_password.WaitProperty("VisibleOnScreen", true, 3000);
path_password.SetText(password);
path_botao.WaitProperty("VisibleOnScreen", true, 3000);
path_botao.DblClick();
Delay(4000);
} // login