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:

import names
def main():
  # ...

  test.vp("SVP1")
  activateItem(waitForObjectItem(names.Menus_QMenuBar, "Edit"))
  activateItem(waitForObjectItem(names.Menus_Edit_QMenu, "Format"))
  activateItem(waitForObjectItem(names.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.

import names
def main():
  # ...

  activateItem(waitForObjectItem(names.Menus_QMenuBar, "Edit"))
  test.vp("SVP1")
  activateItem(waitForObjectItem(names.Menus_Edit_QMenu, "Format"))
  activateItem(waitForObjectItem(names.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: