Trying to log when objects in dropdown are changed
Posted: Wed Jan 29, 2014 9:59 pm
I am trying to create some code that when run tells me if objects were added or removed from a dropdown.
The code I have currently is not working.
I think I may need to convert the objects into strings then add them to a list then compare it with my other list.
IList<ATag> currentList2 = filterOptions.FindDescendants<ATag>();
System.Collections.Generic.List<string> DropdownOps2 = new System.Collections.Generic.List<string>();
DropdownOps2.Add("My Campaigns");
DropdownOps2.Add("My Group");
DropdownOps2.Add("All");
DropdownOps2.Add("Test");
foreach(ATag item in currentList2)
{
string itm = item.InnerText.ToString();
foreach (String value in DropdownOps2){
if(!DropdownOps2.Contains(itm))
Ranorex.Report.Warn(value);
}
if (DropdownOps2.Contains(itm))
Ranorex.Report.Success(itm + " is available");
else
Ranorex.Report.Warn(item + " is not available");
}
The code I have currently is not working.
I think I may need to convert the objects into strings then add them to a list then compare it with my other list.
IList<ATag> currentList2 = filterOptions.FindDescendants<ATag>();
System.Collections.Generic.List<string> DropdownOps2 = new System.Collections.Generic.List<string>();
DropdownOps2.Add("My Campaigns");
DropdownOps2.Add("My Group");
DropdownOps2.Add("All");
DropdownOps2.Add("Test");
foreach(ATag item in currentList2)
{
string itm = item.InnerText.ToString();
foreach (String value in DropdownOps2){
if(!DropdownOps2.Contains(itm))
Ranorex.Report.Warn(value);
}
if (DropdownOps2.Contains(itm))
Ranorex.Report.Success(itm + " is available");
else
Ranorex.Report.Warn(item + " is not available");
}