I have a web page dialog and in there is a Select Drop down called "Encounter Type". I want to select a specific encounter type. (note that some options might be hidden and a scroll bar might appear).
I have attached the snapshot of the "Encounter Selector" Dialog
Screen shot of application showing this drop-down.
My Repository.
.
Code: I want to select the encounter type of "other"
...
...
Repo.WebDocumentEncounter_Selector.SelectTagSelEncounterType
.RMouseClick(message: "Mouse clicked 'Encounter Type' dropdown", delay: 250); //Mouse click to open the dropdown.
OptionTag tag = Repo.WebDocumentEncounter_Selector.SelectTagSelEncounterType.FindSingle("./option[@innertext='Other']");
m_Logger.ReportInfo("----------> " + tag.Visible.ToString());
tag.EnsureVisible(); // I am using ensure visible with the hope that it will scroll the list if the option is not in the visible area.
m_Logger.ReportInfo("----------> After Ensure Visible " + tag.Visible.ToString());
//Issue #1
tag.PerformClick(); //Weird issue. This select the option "CDA" eventhough tag show inner text of "Other"??
//Other options I tried...:
//tag["selected"] = "selected"; //Again selected "CDA". Weird?
Issue #2
//tag.Selected = true; // this selected "Other" however the "OK" button on the dialog is not getting enabled. i.e. App is not seeing the selection.
So:
1. I need to know why Issue #1 is selecting "CDA" when 'tag' option object is for "Other"? This is a bug.
2. What options do I have for issue #2.
Select an "OptionTag" on SelectTag
Select an "OptionTag" on SelectTag
You do not have the required permissions to view the files attached to this post.
Re: Select an "OptionTag" on SelectTag
Have a look at this thread that should help you out with your questions:
http://www.ranorex.com/forum/html-select-box-t1714.html
http://www.ranorex.com/forum/html-select-box-t1714.html
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!
Ciege...
Ciege...
Re: Select an "OptionTag" on SelectTag
yes, we actually tried that approach of dropping the select box down and then finding the "Listitem". That works fine except in the case when the list item is not visible. If the item is not visible, it throws an element not found exception.
Screen shot:
So I added the scroll bar and did a simple while loop like this...
//...Select drop down is already open via click
NOTE: the screen shot above is from my actual run when scroll down btn was pressed like 5 times and you can see the item "other" is indeed visible... But ranorex still did not find it and threw my exception with this message "Encounter Selector ->Encounter Type: Other failed to become visible."
Screen shot:
So I added the scroll bar and did a simple while loop like this...
//...Select drop down is already open via click
Code: Select all
ListItem item = null;
System.DateTime start = System.DateTime.Now;
while (!Repo.ContainerSelectbox.Self.TryFindSingle("./listitem[@text='" + encounterType + "' and @visible='true']", 3000, out item))
{
if( (System.DateTime.Now - start).TotalSeconds > m_WaitCheckTimeoutSecs)
throw new EEHREnsureVisibleFailureException("Encounter Selector ->Encounter Type: " + encounterType + " failed to become visible.");
Repo.ContainerSelectbox.btnLine_down.Click();
m_Logger.ReportInfo("Clicked Line Down");
}
//item.Select(); //dind't work. have to use mouse click
item.RMouseClick(message: "Mouse clicked '" + encounterType + "' on 'Encounter Type' dropdown", delay: 250);
m_Logger.ReportStep("Selected '" + encounterType + "' on 'Encounter Type' dropdown");
NOTE: the screen shot above is from my actual run when scroll down btn was pressed like 5 times and you can see the item "other" is indeed visible... But ranorex still did not find it and threw my exception with this message "Encounter Selector ->Encounter Type: Other failed to become visible."
You do not have the required permissions to view the files attached to this post.
Re: Select an "OptionTag" on SelectTag
Try increasing your findsingle timeout from 3000 to 30000. You could be timing out before Ranorex gets a chance to actually search for and find the item.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!
Ciege...
Ciege...
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Select an "OptionTag" on SelectTag
Hi,
Please could you post us a Ranorex snapshot of the container in your use case above?
To track the container of the select-box you have to use Instant Tracking of Spy and then save it as snapshot.
Instant Tracking
Create a Snapshot
Thanks in advance.
Regards,
Peter
Ranorex Team
Please could you post us a Ranorex snapshot of the container in your use case above?
To track the container of the select-box you have to use Instant Tracking of Spy and then save it as snapshot.
Instant Tracking
Create a Snapshot
Thanks in advance.
Regards,
Peter
Ranorex Team
Re: Select an "OptionTag" on SelectTag
Hello,
I have captured the snapshot of the container that drops down showing the list items. (using instant tracking)
Another Screenshot showing this dropdown. My post above also has the code snippet and the associated repository we use.
I have captured the snapshot of the container that drops down showing the list items. (using instant tracking)
Another Screenshot showing this dropdown. My post above also has the code snippet and the associated repository we use.
You do not have the required permissions to view the files attached to this post.
Re: Select an "OptionTag" on SelectTag
Hello,
For some reason, the snapshot of the Container I attached isn't complete. The size is only 1 KB and is NOT capturing the list items shown. I tried again and the result is the same...
See this screen shot.
For some reason, the snapshot of the Container I attached isn't complete. The size is only 1 KB and is NOT capturing the list items shown. I tried again and the result is the same...
See this screen shot.
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Select an "OptionTag" on SelectTag
Hi,
I think this is a "msaa" limitation. Instead of posting us the Ranorex Snapshot, would it be possible to post us a screenshot where you instant track the combo box and we can also see the spy on this screenshot. Are the list items always invisible or only if you have to scroll to one list item inside the combo box. See Ranorex Spy all elements even, when you have to scroll to elements? (some elements should have the state "visible" and some have the "invisible" state)
Thanks in advance.
Regards,
Peter
Ranorex Team
I think this is a "msaa" limitation. Instead of posting us the Ranorex Snapshot, would it be possible to post us a screenshot where you instant track the combo box and we can also see the spy on this screenshot. Are the list items always invisible or only if you have to scroll to one list item inside the combo box. See Ranorex Spy all elements even, when you have to scroll to elements? (some elements should have the state "visible" and some have the "invisible" state)
Thanks in advance.
Regards,
Peter
Ranorex Team
Re: Select an "OptionTag" on SelectTag
When we run the scripts with our own suiterunner via Teamcity on an agent m/c, for some reason that drop-down shows a scroll-bar within it. (You can see this in the screen shot on second post in this thread dated Tue Nov 09, 2010 2:11 pm)
But the last two screen shot I posted was from my local desktop in which I don't see the scroll bar. I tried reducing the resolution of my desktop down to 800 by 600 and even then the scroll bar wouldn't appear.
But the last two screen shot I posted was from my local desktop in which I don't see the scroll bar. I tried reducing the resolution of my desktop down to 800 by 600 and even then the scroll bar wouldn't appear.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Select an "OptionTag" on SelectTag
Hi,
Maybe the different skin of you operating system, forces your application to paint the combo box in a different way. Have you tried to use the same setting from the computer with the "combo box scrollable" on your computer. Another possibility could be the Internet Explorer. Maybe on your computer is 8.0 installed and on the other machine 7.0.
Regards,
Peter
Ranorex Team
Maybe the different skin of you operating system, forces your application to paint the combo box in a different way. Have you tried to use the same setting from the computer with the "combo box scrollable" on your computer. Another possibility could be the Internet Explorer. Maybe on your computer is 8.0 installed and on the other machine 7.0.
Regards,
Peter
Ranorex Team