Debug Qt application while running Squish GUI tests

Debug Qt application while running Squish GUI tests

Some issues with Application Under Tests (AUT) appear only when a test is executed with Squish. For some cases, it’s easier run our test scenario with Squish than repeating it manually. To get a detailed information about the state of our AUT during a test execution, you can attach to it with an external debugger (gdb/lldb).

How to do it?

      1. Put a breakpoint after startApplication/attachToApplication in the Squish IDE.
      2. Start a Test Case in the Squish IDE and wait until a breakpoint is reached.
      3. Attach gdb/lldb to the running process (gdb has an „attach PID“ command or -p parameter during startup).
      4. Set a breakpoint in the debugger (break command) and resume (continue command) OR display a backtrace (bt command)
      5. Resume execution of a Test Case in Squish IDE.

      Another approach can be used when debugging AUT crashes. For that, we don’t need to attach to running application process. All analysis can be done a post-mortem. Detailed recipe can be found in How to get a backtrace on Unix with the bash or tcsh shell article.

Tomasz Pawlowski started his adventure with Squish and GUI testing in 2011, designing and implementing automated tests for a Flight Planning solution. In 2014 he joined froglogic and has been conducting Squish trainings and consulting for many companies in Europe, India and in the US. Additionally, he works on maintaining Squish integrations. Tomasz has a Master's degree in computer science.

0 Kommentare

Eine Antwort hinterlassen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.