william_roe
11 years agoSuper Contributor
Is there an IndexOf method in TestComplete 10.4?
The following code is
function CheckEmployeeSiteAccess()
{
//
// Sets Whether Employee Should Have Site Access
//
// retrieves reference to browser
var page = Sys.Browser().Page("*");
if(Project.Variables.Employees.Value("SiteAccess") == null){return;}
// retrieves value from 'SiteAccess' column in spreadsheet
var SiteAccess = Project.Variables.Employees.Value("SiteAccess").split(",");
var AllSites = ['Site_2','Site_4','Site_6','Site_8','Site_10','Site_12','Site_14','Site_16','Site_18','Site_30'];
// iterates through array of Site Access(s) and selects
for (var i = 0; i < AllSites.length; i++) {
//Delay(5000);
//Sys.Refresh();
//Log.Picture (obj.Picture(), "image");
//ShowMessage(obj.FullName);
// checks that site is not in list if user doesn't have access
if(SiteAccess.indexOf(AllSites) == -1){
aqObject.CheckProperty(Aliases.browser.CribMaster.headerPrimaryheader.sectionPrimaryinfo.section, "contentText", cmpNotContains, "tstsite_10", false);
}
}
}