Hope you are doing well.
I need to select a drop down & the select items should contain some data. I do not know what are the drop down values are available.
Condition for selected Item are below, both condition should be matched.
List item It should end with “XXXX”
List item It should contain the value - “#####”
My approach - as to get the items present in the drop down, then iterate one by one & get the match. And at the end pass that matched value to drop down.
Please help on this. If you can share one sample code then that will be great.
As far i know, we can do it in below ways,
Way 1: Directly Pass the value to the selector of the drop down.
Way 2: Use get attribute to get the all the available drop down values and store it in a array. Then iterate it and check the required the condition to get the required value to select. But if there is more drop down values then this can not be good choice.
Way 3: use Regex in the Selectors to select the value - see the comments of @bcorrea in this post above.
Way 4: As mentioned by @aanandsanraj in the previous comment.