


Property alias click_button: click_button I copied everything to my tst_gui.qml (leaving my main.qml empty) and it works fine now. I tried importing and using property alias, both didn't work. The test case was not able to find the button since it was in a different QML file. Could someone please help?įinally, I was able to make it work. When I run the test project, I get failure with message: FAIL! : tst_gui::UI Testcase::test_button_click() Uncaught exception: click_button is not definedĬ:\Users\sjayaprakash\Qt Test Projects\Qt Test Validation\QtTestValidation6\QtTestValidation6Test\tst_gui.qml(9) : failure location I have a Button with id "click_button" in "Project/Resources/qml.qrc/main.qml" that I want to simulate. MouseClick(click_button, Qt.LeftButton, Qt.NoModifier) "Project" is the application to be tested and my test cases are in "ProjectTest/Resources/qml.qrc/tst_gui.qml". Here's what I have, I have created a SUBDIRS project with the following structure: ProjectSolution I am validating the Qt Test unit testing framework for Qt Quick and I am not able to understand how to run the tests.
