Mouse.click not working on item in dropdown list

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
kh123
Posts: 10
Joined: Mon Aug 20, 2012 9:39 am

Mouse.click not working on item in dropdown list

Post by kh123 » Wed Nov 21, 2012 11:50 am

I am RDPing into a VM
My test has to select items from dropdown lists
which are dependant on each other.
To explain this
I select a value from Dropdown A. This causes the population of the values in dropdown B

This issue I have is that I cannot get the Mouse.Click to action consistantly

I have
Validated that the list item exists
Checked that the item is visible
no scrolling required

My code opens each dropdown using a mouse clickand and then mouse moves to the item.
On drop A the list is visible and I can see the mouse move to the item on 1 dropdown and then mouse click it which does select it
On dropdown B the initial mouse click opens the list but the list does not always stay displayed so although I can see the mouse move to the screen location of the item I want to select and the report indicates that the click has occured and the items has beem selected nothing has been selected .

I've stepped through the code but when I do that it works. As a result I've tried adding delays to see it that helped but whilst it works as I step through running the script at normal speed I still get the no click

Does anyone have any suggestions?
Thank you

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Mouse.click not working on item in dropdown list

Post by Support Team » Wed Nov 21, 2012 1:35 pm

Hello,

Which Ranorex version are you using?

Is it possible to track your item in Dropdown B?
You could use 'Instant Tracking' for this step with 'Ctrl+Win' Key in Spy.
For more information please take a look at section Tracking UI Elements in our User Guide.

Could you please post a Snapshot of your application?
Pleases take a look at section Creating Ranorex Snapshot Files in our User Guide.

Regards,
Markus (T)

kh123
Posts: 10
Joined: Mon Aug 20, 2012 9:39 am

Re: Mouse.click not working on item in dropdown list

Post by kh123 » Thu Nov 22, 2012 12:20 pm

Hi Markus
My problem has been resolved thank you. I had tried using Select which was able to select the item but then didn't interact with the application and also tried Click which didn't select the item so it was suggested that I Select 1st and then click which appears to do the trick see below

Ranorex.ListItem liitem = Host.Local.FindSingle<Ranorex.ListItem>(xpath, 20000);

if(liitem.Valid)
{
int index = liitem.Index;
ComboBox c = folder;
c.Click();
c.Items[index].Select();
c.Items[index].Click();

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Mouse.click not working on item in dropdown list

Post by Support Team » Thu Nov 22, 2012 1:19 pm

Hello,

You are welcome :)
Thanks for posting your solution.

Regards,
Markus (T)