squish

Squish moveMouse returns Error: Failed to move the mouse


I am using Squish version 6.3.0 Beta for testing the app written in Qt (I know that there is a newer version, but currently it is not possible to do the upgrade). I'm trying to move the mouse to get the tooltips, but the mouseMove command returns the RuntimeError: Failed to move the mouse. The wrapper function is wrienter code heretten in python:

def mouse_move(self, object_name, x, y, timeout=None):
try:
    my_obj = waitForObject(object_name, timeout)
    logging.debug("Found object: {0}".format(my_obj.objectName))
    mouseMove(my_obj, x, y)
    logging.debug("Mouse moved to: {object_name}".format(object_name=my_obj.objectName))
except Exception, e:
    logging.error("Error: {0}".format(e))
    ex_type, ex_value, ex_traceback = sys.exc_info()
    trace_back = traceback.extract_tb(ex_traceback)
    stack_trace = list()
    for trace in trace_back:
        stack_trace.append(
                "File : %s , Line : %d, Func.Name : %s, Message : %s" % (trace[0], trace[1], trace[2], trace[3]))
    logging.error("Exception type: {0}".format(ex_type.__name__))
    logging.error("Exception message: {0}".format(ex_value))
    logging.error("Stack trace: {0}".format(stack_trace))

The output that I get:

16:19:11 DEBUG:    Found object: name_of_the_object
16:19:11 ERROR:    Error: Failed to move the mouse
16:19:11 ERROR:    Exception type: RuntimeError
16:19:11 ERROR:    Exception message: Failed to move the mouse
16:19:11 ERROR:    Stack trace: path/my_squish_wrapper.py , Line : 170, Func.Name : mouse_move, Message : mouseMove(my_obj, x, y)']

Does anyone have any idea why the mouse cannot be moved? Or what I should check to get some more information.


Solution

  • Make sure that the Xtst package is correctly configured when building Squish. Mine was not. Configure warned me with:

    Checking whether XTest extension library is available
    tmp.cpp:1:34: error: X11/extensions/XTest.h: No such file or directory
    tmp.cpp:3: error: ?XTestQueryExtension? was not declared in this scope
    

    After getting the correct package installed, Squish mouseMove (and dragAndDrop operations) are working again.