Squish tip of the week: Stop playback if ANY verification fails

If a verification fails, by default, Squish continues executing the test. By setting the testSettings.throwOnFailure to True, playback will then stop if a any type of verification fails, and raise an error.

See bool testSettings.throwOnFailure to learn more.

Types of verifications:

Squish tip of the week: Confirm expected object timing

The idea behind this tip came from a question how one could confirm a window disappeared if not interacted with for a given period of time.

The result is quite flexible, and can extend beyond the single case.


function logWhenObjectGone(obj){
     var d = new Date();
     var initialTime = d.getTime();
     var timeoutDuration = 20000;
     var marginOfError = 2000
     var objectExists = true;
     waitFor("object.exists(obj)", 20000);
     objectExists = waitFor("!object.exists(obj)", timeoutDuration);
     timeEllapsed = (new Date()).getTime() - initialTime;
     if (objectExists == true){
         test.fail("Object still present after " + String(timeEllapsed) + " miliseconds. Should timeout after " + String(timeoutDuration) + " miliseconds, plus or minus " + String(marginOfError) + " milliseconds (margin of error).")
     } else{
         if (timeEllapsed + marginOfError < timeoutDuration){
             test.fail("Object timedout too soon. Expected timeout: " + String(timeoutDuration) + " miliseconds. Actual timeout: " + String(timeEllapsed) + " miliseconds.")
         } else {
             test.pass("Object no longer present within expected timeframe of " + String(timeoutDuration) + " miliseconds, plus or minus " + String(marginOfError) + " miliseconds. Exact timeout detected: " + String(timeEllapsed) + " miliseconds.")
function main(){
    //not required, but a visual with error often provides value within the results

    // pass a symbolic or real name as the single parameter
    logWhenObjectGone(':Address Book - Add_Dialog');


function enableScreenshots(){
    testSettings.logScreenshotOnFail = true;
    testSettings.logScreenshotOnError = true;
    testSettings.logScreenshotOnPass = true;
function disableScreenshots(){
    testSettings.logScreenshotOnFail = false;
    testSettings.logScreenshotOnError = false;
    testSettings.logScreenshotOnPass = false;  

Squish tip of the week: Convert Symbolic Name to Real Name in 2 Clicks

Squish uses the concept of the Object Map, with Symbolic Names and Real Names available for use in scripts.

At times an object real name may be needed at the script level instead of the symbolic name.

Quickly convert your symbolic name to a real name by right clicking the symbolic name in the script and selecting “Convert to Real Name”

click to zoom


openMenu(waitForObject(":Address Book_Activity"));
openMenu(waitForObject("{text='Address Book' type='Activity' \

Qt World Summit 2015 talks on-line

Beginning of October we sponsored, exhibited and talked at the Qt World Summit in Berlin. It was a great event and we are already now looking forward to next year’s event.

The Qt Company now published the videos of all talks. You can view the talks given by us here:

Squish tip of the week: How to test Single & Multi-Touch Gestures in Mobile Apps

Did you know using Squish’s Gesture Editor you can:

  • Work with Single & Multi-Touch Gestures
  • Record Gestures
  • Manually Build Gestures
  • Edit Gestures
  • Animate or Preview Gestures
  • Call or reuse Gestures

Example Recorded Gesture

click to zoom

Learn more about using single and multi-touch gestures in your mobile app testing by:

Squish tip of the week: Test against multiple applications

Squish can work with more than one applications in a single test

Switch between applications (for recording or playback) using Application Context.

Let’s say you are testing a chat application
  • Two chat sessions are interacting.
  • Even if one session is a Desktop application and the other is a Mobile App – it’s all possible!
Learn more here:


Squish tip of the week: Determine patch regression risk

What if you could determine the impact of a patch on your application?

  • Do you know which tests, if any, validate the impacted code?
  • How about what code or functions were introduced and and require new tests?

Squish Coco’s Patch Analysis report can tell you that and more


You’ve applied a patch to your application. Now you want to know the potential impact of that patch on the stability of your application.

In the prior version of your product you ran your tests (unit, automated, manual, etc.) against your instrumented application (application built with Squish Coco instrumentation enabled).

Now with the patch applied, simply run a diff on the two application versions, and using the diff result, Squish Coco’s Patch File Analysis report reveals:

  • Source code impacted by the modification
  • Which tests cover the impacted code
  • Source code impacted where no tests exist
  • New source code for which tests are needed
  • and more

Assess the risk for potential regressions – what to retest – where new tests are necessary – the impact on your release plan

Snippets from a Sample Report

Overview Statistics

click to zoom

Source Coverage Details

click to zoom

More Information

Squish tip of the week: Reuse script functions in BDD tests

With the introduction of BDD support, all the existing scripts aren’t lost – quite the contrary – existing scripts and functions still work as always, and now those functions can also be called by BDD tests.

Consider the following Test Suite Resource functions:

def invokeMenuItem(menu, item):
    activateItem(waitForObjectItem(":AB_QMenuBar", menu))
    activateItem(waitForObjectItem("{type='QMenu' \
    title='%s'}" % menu, item))
def addNameAndAddress(nameAndAddress):
    invokeMenuItem("Edit", "Add...")
    for fieldName, text in zip(("Forename", "Surname", \
                    "Email", "Phone"), nameAndAddress):
        type(waitForObject(":%s:_QLineEdit" % fieldName)\
             , text)

def checkNameAndAddress(record):    
    table = waitForObject(":Address Book_QTableWidget")
    for column in range(len(record)):
        test.compare(table.item(0, column).text(),