Creating screenshot verification points for volatile objects (QMenu, QAction, Qt)

Last edited on

Overview

Because picking volatile objects is not yet possible with Squish for Qt, creating verification points requires additional steps.

Creating a screenshot verification point for such an object can still be achieved if the respective QMenu and QAction appear in the Application Objects view once your application is in the desired state.

(If these objects are not visible in the Application Objects view, consider How To Pick Menus And Other Volatile Objects instead.)

To check this please do the following:

If you manage to find the respective entry, do the following to create a screenshot verification point:

The code may now look similar to this:

def main():
  # ...

  test.vp("SVP1")
  activateItem(waitForObjectItem(":Menus_QMenuBar", "Edit"))
  activateItem(waitForObjectItem(":Menus.Edit_QMenu", "Format"))
  activateItem(waitForObjectItem(":Edit.Format_QMenu", "Bold"))
test.py

In this example, let us assume that “Format” is the menu entry for which we want to check the icon.

def main():
  # ...

  activateItem(waitForObjectItem(":Menus_QMenuBar", "Edit"))
  test.vp("SVP1")
  activateItem(waitForObjectItem(":Menus.Edit_QMenu", "Format"))
  activateItem(waitForObjectItem(":Edit.Format_QMenu", "Bold"))
test.py

Using masks or different comparison modes

If you want to apply a mask or different mode to screenshot verification points you can do so like this: