Forum Discussion
var p, w, CheckBoxes, i, panel, Name1;
Log.Message(DDT.CurrentDriver.Value("Filter type"))
//define variables for Filter type and Condition dropdown boxes
iexplore = Sys.Process("iexplore", 2);
page = iexplore.Page("https://daffy-v5.phxpd.local/ReportingSystem/Object/ObjectQuery.aspx*");
panel = page.Form("aspnetForm").Panel("ctl00_PageContentPanel").Panel(0).Panel(1);
table = (panel.table("ctl00_PageCenterContentPlaceHolder_DomainDropCheckBoxList"));
// Select the filter drop downs and insert values from spreadsheet
if(panel.WaitSelect("ctl00_PageCenterContentPlaceHolder_filterFieldList", 0).Exists)
panel.Select("ctl00_PageCenterContentPlaceHolder_filterFieldList").ClickItem(DDT.CurrentDriver.Value("Filter type"));
if(panel.WaitSelect("ctl00_PageCenterContentPlaceHolder_DomainFilterDropDownList", 0).Exists)
Delay(500)
panel.Select("ctl00_PageCenterContentPlaceHolder_DomainFilterDropDownList").ClickItem(DDT.CurrentDriver.Value("Condition"));//Is Null;Is Not Null;Is one of;Is not any of
{
var w, PropArray, ValuesArray, ConvertedPropArray, ConvertedValuesArray, i;
// Obtain the panel
w = Sys.Process("iexplore", 2).Page("https://daffy-v5.phxpd.local/ReportingSystem/Object/ObjectQuery.aspx?template=A1a255fbd-49c9-42a1-9de5-e4eff884520b").Form("aspnetForm").Panel("ctl00_PageContentPanel").Panel(0).Panel(1).Table("ctl00_PageCenterContentPlaceHolder_DomainDropCheckBoxList");
// Specify the sought-for property names ..... I do not totally understand this selection
PropArray = new Array ("all");
// Specify the sought-for property values
ValuesArray = new Array ("*");
// Converts arrays
ConvertedPropArray = ConvertArray(PropArray);
ConvertedValuesArray = ConvertArray(ValuesArray);
// Find all checkboxes in the window (defined as the variable w)
checkBoxes = w.FindAllChildren(ConvertedPropArray, ConvertedValuesArray, 1);
checkBoxes = VBArray(checkBoxes).toArray();
}
function ConvertArray(AArray)
{
// Uses the Dictionary object to convert a JScript array
var objDict = new ActiveXObject("Scripting.Dictionary");
objDict.RemoveAll();
for (var j in AArray)
objDict.Add(j, AArray
return objDict.Items();
}
Log.Message ("Total number of found checkboxes:" + checkBoxes.Length); //log how many items are in the array
for (i = 0; i < checkBoxes.length; i++) //checkboxes array is stepping though the names
{
CB = (checkBoxes.innerText); //Assign values to variables to populate the querry string to see if the checkbox is selected (T/F)
CB5 = eval(checkBoxes).Name;
Log.Message(DDT.CurrentDriver.Value(CB));
table.Cell(162,4).Checkbox("ctl00_PageCenterContentPlaceHolder_DomainDropCheckBoxList_814").ClickChecked(false);
eval(table.Name + "." + CB5).Checkbox("ctl00_PageCenterContentPlaceHolder_DomainDropCheckBoxList_814").ClickChecked(DDT.CurrentDriver.Value(CB));
}
Related Content
- 11 years agoashok_natar
- 5 years agosenthkum