Hi
I am trying to scroll to a value in a drop-down menu and select it using C# code. The code is Flex.
I am able to select the value (VPAID) successfully, if it is visible when i click on the drop-down, but when it is not visible - the selection fails. I am using this method:
Element.FindSingle<Ranorex.Text>(".//text[@Text='VPAID']").Click();
How do I scroll down using C# code until the value is visble? is there another approach?
Thanks
How to scroll using C# code?
Re: How to scroll using C# code?
Easiest way I found is to use keyboard commands... Something like the following... This will work for most any drop list quite reliably.
*) Open the drop down
*) If item is visible in the list, click it
else
*) press HOME key to go to the top of the list
*) While item is not visible
*) Press down arrow
*) if item is visible click it
*) Loop
*) Open the drop down
*) If item is visible in the list, click it
else
*) press HOME key to go to the top of the list
*) While item is not visible
*) Press down arrow
*) if item is visible click it
*) Loop
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...
-
- Posts: 14
- Joined: Mon Mar 18, 2013 1:06 pm
Re: How to scroll using C# code?
Thank you
Re: How to scroll using C# code?
Hi,
For drop-down menu I follow these steps:
hope it helps.
regards,
Mateo.
For drop-down menu I follow these steps:
- 1. Click over it
2. Simulate pressing the First letter of the list (it forces to select the top element)
3. Repeat Step 2 with the first letter of the element I need to select.
hope it helps.
regards,
Mateo.