I want to get all the options as an array from a dropdownlist. Can you please help me?
Hi
we can use find children activity to get all the items from the drop down.
The find children activity returns an ienumerable list, which you can iterate using a for loop and get its name using a get attribute activity and mention the attribute property as “aaname”
For more details this thread would help u with an xaml
To get as an array, first let’s get the value from find children and get attribute
Assign the output you get from get atttibute to a activity called ADD TO COLLECTIONS
Where in collection property mention as listoutput
Where listoutput is a variable of type system.collections.generic.list(of string) with default value as nee list(of string) created in variable panel
And in Item property pass the output variable we got from get attribute
Cheers @Hulya_Cetinkaya
Hi @Hulya_Cetinkaya ,
Use get attribute activity and choose inner text. It should list out all the options in drop down. Now split it and save it in array variable.
- Use Find Children activity and indicate the element and create an output Variable
- Use For Each activity and Get the value from the Get Attribute Activity.
Refer to the video Link:
Regards
Gokul
Use get full text and indicate the dropdown you will get the list of items as String and split by Environment.newLine ! and store it as array
Regards
find some example with visiuals on the steps
to get all values as an array we can do:
YourFindChildrenOutputVar.Select(Function (x) x.Get("innertext").ToString).ToArray
puedo hacer una consulta antes es decir vAlfDeserealiza.Select(Function (x) x(“children”).ToString) When vAlfDeserealiza.ToString.Contains(“”“hasChildren”“: true”)??
just open an new topic for your case as the request is not clear. In case of you want to check if a particular item is contained we can do:
YourFindChildrenOutputVar.Any(Function (x) x.Get("innertext").ToString.Equals("YourKeyWord"))