Verification Point Creator
The Verification Point Creator view appears automatically when you select a property in the Properties view. It accumulates a list of one or more property verifications that you can insert into the test script that is being recorded or that is being played and is stopped at a breakpoint.
The Verification Point Creator view
In the example shown in the screenshot, clicking the Insert button inserts the following lines into a Python test script (the code for other languages is very similar):
test.compare(waitForObjectExists(":Invoice:_QComboBox").currentText, "AXV-12200") test.compare(waitForObjectExists(":This Payment:_QSpinBox").value, 350) test.compare(waitForObjectExists(":Make Payment.Credit Card_QRadioButton").checked, True)
Even though you could write the same verifications by hand, in practice you would use the following style instead:
comboBox = waitForObject(":Invoice:_QComboBox") test.compare(comboBox.currentText, "AXV-12200") spinBox = waitForObject(":This Payment:_QSpinBox") test.compare(spinBox.value, 350) radioButton = waitForObject(":Make Payment.Credit Card_QRadioButton") test.verify(radioButton.checked)
To invert the meaning of a verification shown in the view, select the Expected Failure checkbox and change the value to one you do not expect. In the example above, set the radio button's checked
value to false
and select the associated Expected Failure checkbox to generate a call to the Boolean test.xcompare(value1, value2) function rather than to the Boolean test.compare(value1, value2) function and to use the value false
in the comparison.
To remove a verification before it is inserted, click its associated Delete button. You must delete already inserted verifications from the test script's code.
Scriptified and properties VPs
By default, verifications are inserted as Scriptified Properties VPs, that is, as code. This is the most convenient way to insert verifications because they are easy to read, modify, or delete.
You can insert a verification as a Properties VP to create a new resource called VP1 in Test Suites > Test Case Resources > VPs.
Such verifications are inserted into the test script as calls to the Boolean test.vp(name) function with the name of the verification point being passed as the sole parameter. If you change the name in the VPs tab, also change it in the call to the Boolean test.vp(name) function.
If you delete a verification from the VPs tab, you must also delete any associated calls to the Boolean test.vp(name) function that refer to the deleted verification.
Screenshot VPs
Alternatively, you can insert a Screenshot VP in the Application Objects view.
The Verification Point Creator view with a Screenshot VP
To create a screenshot verification, double-click an object. Click the top-level object for a screenshot of the whole application. The image above takes a screenshot of the spinbox.
Screenshot verifications appear as resources in the VPs tab and are invoked by a call to the Boolean test.vp(name) function. If you rename them, you must change the name used in the Boolean test.vp(name) function call to match. If you delete them, also delete the Boolean test.vp(name) function call.
In general, property verifications are more reliable than screenshot verifications because the latter can be affected by changes in the system environment. For example, if you change the computer's theme, a different font might be used or widget borders might become thinner, thicker, or differently colored than before, and so on. So, for this example, it is much better to verify the amount (350) than to use screenshot verification.
See also, How to Create and Use Verification Points and Verification Functions.
© 2024 The Qt Company Ltd.
Documentation contributions included herein are the copyrights of
their respective owners.
The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.
Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners.