Object synchronization functions such as waitForObject or waitForObjectItem may return various error messages. Fully understanding these messages is important to debug a test script.

squ recognizes GUI objects by a subset of their properties and values. In the example below, we would like to click on an object of type QToolButton with text “New”.

clickButton(waitForObject("{text='New' type='QToolButton'}"))

waitForObject/waitForObjectItem looks for an object with given properties and values. Additionally, it requires the object to be accessible (existing, enabled, visible). Those additional requirements are imposed because waitForObject/waitForObjectItem is used when we want to interact with GUI object (for example click an object or type to an object). When Squish finds at least one object matching the above condition, waitForObject/waitForObjectItem returns a reference to it.



LookupError: Object <name> not found. Could not match properties:
    type for object name: <name> 


LookupError: Object <name> not found. Could not match properties:
    <property> for object name: <name> 


LookupError: Object <name> not ready. 

When all the above checks are performed then waitForObject/waitForObjectItem returns an object reference. Also, the above error messages are clear, so a user can find a cause of an error.


当鳞片升起时有一种情况“Object not ready”需要更多解释的错误。让我们假设我们在我们的应用程序中有以下两个按钮:

Button1与文本“New”, currently hidden
button2与文本“New”, currently visible


clickButton(waitForObject("{text='New' type='QToolButton'}"))

事实上,可能会发生这种情况“Object not ready”出现错误。原因是首先找到Button1(所有属性匹配)。对于此按钮,执行可访问性检查失败。如何避免这种情况?只需添加一个可见的属性:

clickButton(waitForObject("{text='New' type='QToolButton' visible='1'}"))


您的电子邮件地址不会被公开。 必需的地方已做标记 *