This is why i don't deal with RegExp.
As I'm not busy in my work this made me some interesting job :smileyvery-happy:, Try with below code you will have successful result i hope and also you will know why it is getting failed
var page, mainMenu;
function getpage() {
page = Sys.Browser("iexplore").Page("https://*.imedconsent.com/*");
return page;
}
function getmainMenu() {
//mainMenu = getpage().FindChild("idStr", "regexp: (mainMenuInner)|(navMenuInner)", 10);
var mainMenu = page.Find("idStr", "mainMenuInner", 10, true);
var navMenu = page.Find("idStr","navMenuInner", 10, true);
var menuObject = null;
if(mainMenu.Exists)
{
menuObject = mainMenu;
Log.Message("selected the object with idStr as mainMenuIner");
}
else if(navMenu.Exists)
{
menuObject = navMenu)
Log.Message("selected the object with idStr as navMenuInner");
}
return menuObject;
}
// var page = Sys.Browser("iexplore").Page("https://*.imedconsent.com/*");
// var mainMenu = page.FindChild("idStr", "regexp: (mainMenuInner)|(navMenuInner)", 10);
function swceProcPatient(){
var mainObject = getmainMenu();
if(mainObject != null)
{
var menuProcPatient = mainObject.FindChild("contentText", "Process Patients", 20);
menuProcPatient.Click();
}
else
{
Log.Error("Main menu not found");
}
}
function swceReports(){
var mainObject = getmainMenu();
if(mainObject != null)
{
var menuReoports = mainObject.FindChild("contentText", "Reports", 20);
menuReoports.Click();
}
else
{
Log.Error("Main menu not found");
}
}
function swceGroups(){
var mainObject = getmainMenu();
if(mainObject != null)
{
var menuGroups = mainObject.FindChild("contentText", "Groups", 20);
menuGroups.Click();
}
else
{
Log.Error("Main menu not found");
}
}
function fodSelectPatients(){
var mainObject = getmainMenu();
if(mainObject != null)
{
var menuSelectPatients = mainObject.FindChild("contentText", "Select Patients", 20);
menuSelectPatients.Click();
}
else
{
Log.Error("Main menu not found");
}
}
function swceHome(){
var mainObject = getmainMenu();
if(mainObject != null)
{
var menuHome = mainObject.FindChild("contentText", "Home", 20);
menuHome.Click();
}
else
{
Log.Error("Main menu not found");
}
}
function swceLogOut(){
var mainObject = getmainMenu();
if(mainObject != null)
{
var menuLogout = mainObject.FindChild("contentText", "Logout", 5);
menuLogout.Click();
}
else
{
Log.Error("Main menu not found");
}
}