Forum Discussion

vijay6105's avatar
vijay6105
Contributor
13 years ago

simulating mouse pressing button

Hello,



I'm using windows application. I need to simulate pressing mouse left button for a while on a specific coordinates inside my windows application. i need the method to be used for this operation.



MouseDown method is there but it is used with screen coordinates. I have to simulate mouse pressing on specific object in my application, how can it be done

  • Hi Vijay,





    You can try using the needed object's properties to calculate coordinates for the MouseDown method, e.g.:




  • Hello,



    Object's screen coordinates X, Y values are Zero, screenleft and sreentop values are 0. Only width, height, top and bottom values are there with respect to object location in the application.

    I can't get the screen coordinates, is there a method/ solution to do with respect to object location in the application not with desktop/screen coordinates 
  • Hello,



    Can I do mouse pressing on an object with respect to object coordinates in the application not with the screen coordinates 
  • AlexeyKryuchkov's avatar
    AlexeyKryuchkov
    SmartBear Alumni (Retired)
    Hi Vijay,



    Can I do mouse pressing on an object with respect to object coordinates in the application not with the screen coordinates 


    Could you please let me know why you need this? Have you tried simply recording tests?
  • Hello,



    I'm working on windows application. I have to perform mouse pressing on a specific object. Problem is there is one method(MouseDown) which does mouse pressing on an object with respect to screen coordinates. In my application I can get object coordinates with respect to windows application not with screen coordinates. Is there a method to do mouse pressing on an object other than using screen coordinates?