C++ Qt自动化测试
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4129430/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Qt automated testing
提问by Edward Strange
http://www.automatedqa.com/products/testcomplete/testing-qt-apps/
http://www.automatedqa.com/products/testcomplete/testing-qt-apps/
How would they have been able to do that? Is there a Qt inspection library? Standard window spy tools work in some areas, but other important areas (such as list items in a list view) are not inspectable through Windows messages.
他们怎么能做到这一点?有Qt检查库吗?标准窗口间谍工具可在某些区域工作,但其他重要区域(例如列表视图中的列表项)无法通过 Windows 消息进行检查。
I know there's the QtTest framework, but what I'd like is something that can access an application as a whole so that I can have automated integration testing.
我知道有 QtTest 框架,但我想要的是可以访问整个应用程序的东西,以便我可以进行自动化集成测试。
采纳答案by Edward Strange
Found the answer: http://www.ranorex.com/support/user-guide-20/qt-accessible-plugin.html
找到答案:http: //www.ranorex.com/support/user-guide-20/qt-accessible-plugin.html
http://doc.qt.io/archives/4.3/accessible.html
http://doc.qt.io/archives/4.3/accessible.html
Exactly what is needed to automate a UI. Will then work with any UI automation software, which I've now learned apparently uses the accessibility API.
正是自动化 UI 所需要的。然后将与任何 UI 自动化软件一起使用,我现在了解到这些软件显然使用了可访问性 API。
回答by Frank Osterfeld
回答by pedromateo
I along with my team recently developed TUG, an open-source framework for Qt GUIs Unit Testing. It uses Qt Test. Maybe it can help you.
我和我的团队最近开发了 TUG,这是一个用于 Qt GUI 单元测试的开源框架。它使用 Qt 测试。也许它可以帮助你。
A video better than a thousand words: https://www.youtube.com/watch?v=tUis6JrycrA
一个胜过千字的视频:https: //www.youtube.com/watch?v=tUis6JrycrA
Hope we can make it better together. Github repo: http://pedromateo.github.io/tug_qt_unit_testing_fw/
希望我们可以一起做得更好。Github 仓库:http: //pedromateo.github.io/tug_qt_unit_testing_fw/
回答by pedromateo
Also answered in Best approach to QT UI testing
也回答了QT UI 测试的最佳方法
You can use OpenHMITester (OHT), that is an open-source GUI Testing tool following an open architecture that describes a non intrusive capture/replay tool based on GUI Events. It was implemented to be used in Qt; however, it may be adapted to support different windowing systems and operating systems used in the testing environment. (Download) (Further info)
您可以使用 OpenHMITester (OHT),它是一种开源 GUI 测试工具,遵循开放架构,描述了基于 GUI 事件的非侵入式捕获/重放工具。它被实现以在 Qt 中使用;但是,它可以适用于支持测试环境中使用的不同窗口系统和操作系统。(下载)(更多信息)