Determining if dropdown values change?

Class library usage, coding and language questions.
Rebus
Posts: 5
Joined: Wed Jan 08, 2014 6:50 pm

Determining if dropdown values change?

Post by Rebus » Wed Jan 08, 2014 6:53 pm

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?

Rebus
Posts: 5
Joined: Wed Jan 08, 2014 6:50 pm

Re: Determining if dropdown values change?

Post by Rebus » Thu Jan 09, 2014 7:01 pm

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?

User avatar
BernhardS
Ranorex Guru
Ranorex Guru
Posts: 36
Joined: Tue Dec 17, 2013 6:35 pm

Re: Determining if dropdown values change?

Post by BernhardS » Mon Jan 13, 2014 10:41 am

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

Rebus
Posts: 5
Joined: Wed Jan 08, 2014 6:50 pm

Re: Determining if dropdown values change?

Post by Rebus » Mon Jan 13, 2014 2:22 pm

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?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Determining if dropdown values change?

Post by Support Team » Tue Feb 04, 2014 2:30 pm

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
.
Image