mouseClick() function does not work when coordinates are passed in
-
Hi,
Im working with Qt embedded app. My toolkit for Squish is Qt.
I noticed that when I usemouseClick(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?
-
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.
-
M MRosiek has marked this topic as solved