Page 1 of 1

Determining if dropdown values change?

Posted: Wed Jan 08, 2014 6:53 pm
by Rebus
I want to set up Ranorex to tell me when a dropdown either adds more items or items are removed from the dropdown. Is it possible to use validation to determine this?

Re: Determining if dropdown values change?

Posted: Thu Jan 09, 2014 7:01 pm
by Rebus
Just to help clarify if its not doable on its own could I have two versions of the software running and compare the changes in the dropdown?

Re: Determining if dropdown values change?

Posted: Mon Jan 13, 2014 10:41 am
by BernhardS
Hello Rebus,

I am not exactly sure if I got your question, but you can for example save the data in an external file.
Please describe your issue in more detail if I didn't understand you correctly.

Regards,
Bernhard

Re: Determining if dropdown values change?

Posted: Mon Jan 13, 2014 2:22 pm
by Rebus
We have dropdowns that have values added to them every build. I want to compare an old build to the new build and see what a developer has added to the dropdown. For example if in the first build we have values of yes and no in a dropdown and in the second build maybe is added to the dropdown. I want to know if Ranorex can detect that change somehow?

Re: Determining if dropdown values change?

Posted: Tue Feb 04, 2014 2:30 pm
by Support Team
Hello all,

Rebus also wrote an email to [email protected]. I just want you guys know that he could solve the issue by comparing the lists using a foreach loop.
Here is a short example:
var someSelectTag = repo.SomeSelectTag;
IList<OptionTag> currentList = someSelectTag.FindDescendants<OptionTag>();
System.Collections.Generic.List<string> currentStringList = new System.Collections.Generic.List<string>();

foreach(OptionTag item in currentList)
{
	string itm = item.InnerText.ToString();
	currentStringList.Add(itm);
}

System.Collections.Generic.List<string>  DropdownOps = new System.Collections.Generic.List<string>();
DropdownOps.Add("Volvo");
DropdownOps.Add("Opel");
DropdownOps.Add("Saab");
DropdownOps.Add("Audi");
DropdownOps.Add("VW");

foreach(string item in DropdownOps)
{
	if (currentStringList.Contains(item))
		Report.Info(item + " is available");
	else
		Report.Info(item + " is not available");
}
Regards,
Bernhard