Hi,
I am trying to select any of the values available in the drop down using tagValue which is not usefull
I want to select the value from the drop down using "text"
Moreover after that I want to store all the values available in the drop down in to a List
Please help me to understand how can click any value in the drop down using Get Text
And after that how can I store all values in a LIST
I have attached the drop down screenshot and snapshot both
Please help me with the issue
Regards
Store the dropdown values into a list and compare
Store the dropdown values into a list and compare
- Attachments
-
- DropDown1Snapshot.rxsnp
- (56.55 KiB) Downloaded 9 times
-
- DropDown1.PNG (15.66 KiB) Viewed 418 times
-
- DropDown2.PNG (16.52 KiB) Viewed 418 times
Re: Store the dropdown values into a list and compare
Hi,
I see you are using Chrome, which has a known limitation regarding combo boxes. To select an item in the list, you will have to KeySequence, instead of mouse click. See this post:
https://www.ranorex.com/forum/code-for- ... tml#p51870
As for obtaining list of items in code, you can use this approach:
You need to create a repo item, which points to all items of given combo box
/dom[@page='']//div[#'wrapper']//div//select[@visible='true']/option
The problem is, that there are no IDs to uniquely identify individual combo boxes, so you will have improve the xpath to find only the items from actually expanded combo box. This should probably work:
/dom[@page='']//div[#'wrapper']//div//select[@visible='true']/option[@visible='true']
Now you can use this code (as user code action in Recording module), which must be linked to above created repo element...
Hope this helps?
I see you are using Chrome, which has a known limitation regarding combo boxes. To select an item in the list, you will have to KeySequence, instead of mouse click. See this post:
https://www.ranorex.com/forum/code-for- ... tml#p51870
As for obtaining list of items in code, you can use this approach:
You need to create a repo item, which points to all items of given combo box
/dom[@page='']//div[#'wrapper']//div//select[@visible='true']/option
The problem is, that there are no IDs to uniquely identify individual combo boxes, so you will have improve the xpath to find only the items from actually expanded combo box. This should probably work:
/dom[@page='']//div[#'wrapper']//div//select[@visible='true']/option[@visible='true']
Now you can use this code (as user code action in Recording module), which must be linked to above created repo element...
Code: Select all
public void GetListItems(RepoItemInfo selectItemsInfo) // where listItemsInfo points to the repo element, with xpath returning list of all select tag items
{
IList <Ranorex.OptionTag> selectItemsList = selectItemsInfo.CreateAdapters<Ranorex.OptionTag>(false);
foreach (Ranorex.ListItem selectItem in selectItemsList)
{
//do whatever you want with obtained select item ;)
}
}
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Store the dropdown values into a list and compare
Hi,
Individual values in the drop down are not identified as the drop down is a container
While Storing it into a list Options Tag is throwing an error
I tried with Select tag and container but it is not working out
Mainly the first objective now is to click any specific value from the drop down using the name not the tagValue
Is there any other way can we try Sir
Regards
Individual values in the drop down are not identified as the drop down is a container
While Storing it into a list Options Tag is throwing an error
I tried with Select tag and container but it is not working out
Mainly the first objective now is to click any specific value from the drop down using the name not the tagValue
Is there any other way can we try Sir
Regards
Re: Store the dropdown values into a list and compare
Hi,
As I mentioned in previous post, individual combo box items cannot be tracked and clicked in Chrome. You must use Key Sequence action instead. See the link in my previous answer.
As I mentioned in previous post, individual combo box items cannot be tracked and clicked in Chrome. You must use Key Sequence action instead. See the link in my previous answer.
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration