Point

Aug 31, 2010 at 1:41 PM

Hello, I am not familiar with the Keyword 'Point' . I have seen it used it with Mouse.Instance. to click on the center of a button. Can anyone provide some example and explanation? I am having idfficulty on clicking  a button and it seems that I need to use Mouse.Instance with 'Point' and gives an error "are you mssing a using directive or an assembly reference". Can someone help? Thanks a lot.

Sep 2, 2010 at 6:50 AM

Hi

 

can you explainwhat problems do you have using Button.Click()?

 

Throndorin

Sep 2, 2010 at 4:26 PM

Hi Throndorin,

I want to click in the middle of the button.  I use Click () on button and it does not work.

I also notice that the UI spy does not have this element listed, and on bringing the focus on this element, the output section of the UI spy says, Element "" Sign In (name of the button). Also the message on UI spy is UI automation tree navigation is broken. The parent of the descendants exist but the descendant isnot the child of hte parent. I just started looking at White for the automation so not really sure. Thanks in advance.

Sep 3, 2010 at 6:07 AM

Hi

UISpy can't find the button?

than White can not click on it

 

Point is a class which handels coords, so the x and y position of a point in pixel on your screen.

 

for exapmle:

 

a white element has clickablePoint if you have a look at this will get an object of type point wit x and y coords.

 

you can use the parent element as help and search from there.

 

example

---parent element -------------

|  +Button+                          |

|                                          |

|--------------------------------- |

 

 parent.Bounds.TopLeft.X and parent.Bounds.TopLeft.Y gives you the TopLeft corner position of your parent element

 

Point clickablePoint = new Point(parent.Bounds.TopLeft.X+30, parent.Bounds.TopLeft.Y-30);

Mouse.Instance.Click(clickablePoint);

 

Maybe I mixed the direction where you should increase or decrease from the corner as starting point.

Throndorin

 

 

 

 

Sep 8, 2010 at 4:48 AM

Thank you for the detail explanation.