Forum Discussion

leandropoblet's avatar
leandropoblet
Frequent Contributor
9 years ago

how to click on objects using screen coordinates when ["Click"] method use relative coordinates?

 

Hey so I need to click on a DevExpress barControl object. The number of buttons in the bar is variable and the number of buttons being displayed at any given time depends on the windows size, so if user uses full screen or not also affects.

 

The arrow pointing down I'm trying to click on (pls look attached image) is completely unknown/unseen by TestComplete in the object browser, so the only way to automate a click on a "non object" is using screen coordinates.

 

The only information I've got relative to the button I want to find (and click on) is if it's visible on the screen or not. So if it's not it's obviously under the arrow (drop down menu from there and it's easy to work it out from then on) but the arrow itself is impossible to find.

 

Now the "Click" method uses coordinates relative to the object:

 
ClientX

Specifies the horizontal coordinate of the point of the click. This coordinate is relative to the object, it is not a screen coordinate. If ClientX is omitted, the click will be simulated in the center of the object.

ClientY

Specifies the vertical coordinate of the point of the click. This coordinate is relative to the object, it is not a screen coordinate. If ClientX and ClientY parameters are omitted, the click will be simulated in the center of the object.
 

In this case I need a click method which has screen coordinates and also a way to calculate those values.

 

Did anyone out there have the same/similar situation? How did you end up solving the problem?

 

Cheers,

Leandro

11 Replies

  • NisHera's avatar
    NisHera
    Valued Contributor

    I aslo tests application uses dev express controls..

    with object spy I found ItemsLinks property which has items (indexed) property.

    which was usefull in identifying individual buttons

    it's worth to try drilliing down properties which are objects

     

     

    • leandropoblet's avatar
      leandropoblet
      Frequent Contributor

      Hi NisHear,

       

      Thanks for your reply. I've tried solutions like that, the problem is not how to identify the buttons on the bar, but this arrow in particular can never be highlighted with the object browser tool and as you can see in the attachment there's nothing in between the BarButtonItemLinkControl 18 and 19 which is where the arrow is at the moment (given the size of the screen for this user).

       

      Cheers,

      Leandro

    • leandropoblet's avatar
      leandropoblet
      Frequent Contributor

      Hi NisHera,

       

      did you ever use screen coordinates before? Can you help me on that maybe?

       

      Cheers!

      • NisHera's avatar
        NisHera
        Valued Contributor

        me too not found usefull properties in object browser

        But in object spy , I could drill down 

        try to drill down properties which has names like Item and value (Object)