3

I have a task to automate Qt QML based desktop applications through open source frameworks. I am completely new to testing and also to Qt QML. I am good with Java and Python and also Javascript.

  1. Can someone please suggest a way to write automation tests for Qt QML desktop application?
  2. Can I code things to read the elements and widgets in the Qt QML applications?, So I can validate various cases.
  3. If so, are there any tutorials or sample automation test projects for Qt QML applications?
11
  • 1
    Check QML TestCase Commented Oct 11, 2018 at 6:10
  • 1
    How to create a Qt-Quick Test Commented Oct 11, 2018 at 6:11
  • Thanks @MohammadKanan, these seems to be for unit tests that comes within applications. Is there any way to write tests for the application in a separate project?. So that I can run the tests externally Commented Oct 11, 2018 at 7:05
  • External application to "read elements and widgets"? Commented Oct 11, 2018 at 7:14
  • 1
    Take a look at Squish Commented Oct 11, 2018 at 9:37

1 Answer 1

6

Have a look at Spix. Once you link against it, you can remote control your QML UI by sending fake events, either from C++, or from a script using RPC. Any scripting language that supports XML-RPC, like python, can be used. This way, you can automate and test your Qt/QML application.

Objects are identified by paths, so you don't have to deal with coordinates. Spix finds the item by the objectName property set in QML. You can also query object properties from the script...

The library is fairly new and under development, but I think it already covers a lot of the more common use cases in desktop apps...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.