Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. QA Tools
  3. Squish
  4. mouseClick() function does not work when coordinates are passed in

mouseClick() function does not work when coordinates are passed in

Scheduled Pinned Locked Moved Solved Squish
2 Posts 1 Posters 186 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • MRosiekM Offline
    MRosiekM Offline
    MRosiek
    wrote last edited by
    #1

    Hi,
    Im working with Qt embedded app. My toolkit for Squish is Qt.
    I noticed that when I use

    mouseClick(my_symbolic_name_here_of_the_object)
    

    it works, element is being clicked.

    What I wanted now to do is to call this function in such way:

    mouseClick(symbolic_name, x_coor_within_object, y_coor_within_object, 0, 4) #  no modifiers for click (left button and no modifiers)
    

    But this call does not work for me. Element is not being clicked at all.
    The code which Im using is following:

        def mouse_click(self, object_real_name: dict, x: int = 0, y: int = 0, modifier=0, button=4):
            """Clicks in position of object which is referenced by `object_real_name`."""
            print(f"*INFO* Mouse clicking on object: {object_real_name} at position x:{x}, y:{y} with modifier:{modifier} and button:{button}")
            squishtest.mouseClick(squishtest.waitForObject(object_real_name), x, y, modifier, button)
    

    I have also tried using this one:

        def mouse_click_at_coordinates(self, x: int, y: int, modifier=0, button=4):
            """Clicks at given screen coordinates (x,y)."""
            screen_point = squishtest.UiTypes.ScreenPoint(x, y)
            squishtest.mouseClick(screen_point, modifier, button)
    

    But with no avail.

    I would love to have function which clicks on desired x and y (without need of object reference).

    Any ideas what am I doing wrong here?

    1 Reply Last reply
    1
    • MRosiekM Offline
      MRosiekM Offline
      MRosiek
      wrote last edited by
      #2

      Alright, that was quick... First thing I misinterpreted the button int value. I wanted leftButton to be pressed. I used int value 4 instead of 1. Next one was that I thought Im clicking desired object on the screen but it was composed from few others so coordinates 0,0 was pointing beyond the element which I was planning to click upon.

      1 Reply Last reply
      1
      • MRosiekM MRosiek has marked this topic as solved

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved