图像识别推动测试自动化

发布于 2024-08-06 15:35:27 字数 1539 浏览 18 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

身边 2024-08-13 15:35:27

好的,首先,我确实理解前面的答案:使用图像识别测试应用程序并不是测试 GUI 的最佳方法。但同时,我不明白为什么你不首先回答这个问题。他要求以这种方式工作的工具,我认为他足够聪明,能够理解他要进入的领域。

好的,现在是主题,我的选择包括:

  • Sikuli,一个类似 GNU MIT 许可证下的 MIT 项目。它使用 Python 而不是 Jython。自由的。
  • TestPlant EggPlant,一个通过 VNC 服务器工作的工具,因此您可以在任何 VNC 中测试应用程序兼容平台(包括智能手机)。它有一些不错的功能,如 OCR、测试计划等。它使用SenseTalk。不是免费的,您可以请求试用。
  • Routine Bot,我从未使用过它,但它似乎非常有用。

Ok, first of all, I DO understand the previous answers: testing apps using image recognition isn't the best way to test GUIs. But, at the same time, I don't understand why you aren't answering the question in first place. He's asking for tools that work that way, I'd think he's smart enough to understand where he's going into.

Ok, now the main subject, my choice would includes:

  • Sikuli, a MIT project under the GNU-like MIT license. It uses Python over Jython. Free.
  • TestPlant eggPlant, a tool that works through a VNC server, so you can test apps in any VNC compatible platform (including smartphones). It has some nice features like OCR, test schedule and so on. It uses SenseTalk. Not free, you could request a trial.
  • Routine Bot, I've never used it but it seems pretty useful.
阳光下慵懒的猫 2024-08-13 15:35:27

我也不鼓励使用带有 SendKeys 的图像识别和单击坐标或(按钮图像)来进行 UI 测试。我最近一直在使用 UI Automation 来自动化 WPF 应用程序的测试,并取得了成功。通过在应用程序的 XAML 中放置小面包屑 (Automation.AutomationID="OkButton"),我已经能够编写一些 C# 单元测试来测试应用程序的不同方面。即使没有面包屑,UI 自动化仍然能够运行应用程序,但在尝试识别 UI 上的控件时会稍微困难一些。

关于代码项目的一篇不错的文章可以作为起点。

http://www.codeproject.com/KB/WPF/UIAutomation.aspx

您还需要 UI Spy,这是 Microsoft 提供的免费工具,它可以帮助您查找控件并通过 UI Automation 手动执行控件,作为编写脚本的指导。该工具隐藏在 Windows Vista SDK 中,安装后搜索 UISpy.exe。 UI Spy 工具仍然可以在 Windows XP 计算机上运行,​​只需将 EXE 复制到目标计算机即可。

I would also discourage using Image Recognition with SendKeys and Click at Coordinates or (Button Images) to do UI testing. I have been recently using UI Automation to automate the testing of a WPF application with success. By placing small breadcrumbs (Automation.AutomationID="OkButton") throughout our application's XAML I have been able to write some C# Unit Tests that exercise different aspects of the application. Even without the breadcrumbs UI Automation is still capable of exercising an application, but it is slightly more difficult when trying to identify the controls on the UI.

A decent article on Code Project is available as a starting point.

http://www.codeproject.com/KB/WPF/UIAutomation.aspx

You will also need UI Spy, a free tool from Microsoft, which helps you find controls and manually exercise the controls through UI Automation as guidance for writing the scripts. The tool is buried in the Windows Vista SDK, after installation search for UISpy.exe. The UI Spy tool can still run on a Windows XP machine by just copying the EXE to the target machine.

情深已缘浅 2024-08-13 15:35:27

考虑使用 AutoItScript 在测试场景中驱动基于 Windows 的 GUI - 并删除 UI。考虑 tesseract 开源光学字符识别。还有用于机器视觉的 OpenCV。

免费的 AutoItScript 在 API 级别工作,您可以读取各种小部件和 Windows 部分的状态,也向这些 UI 组件发送操作,等待状态更改等。可以生成高度健壮的自动化代码,以确保专注于 Windows 和分辨率独立。

Consider AutoItScript for driving Windows-based GUIs in test scenarios - AND scraping off the UIs. Consider tesseract open source optical character recognition. Also OpenCV for machine vision.

Free AutoItScript works at the API level in that you can read states of various Widgets and Windows sections, send actions to these UI components too, wait for state changes etc. It's possible to produce highly robust automation code that will ensure focusing on Windows and resolution independence.

夜夜流光相皎洁 2024-08-13 15:35:27

让我建议另一个解决方案。
它不是一个完整的 UI 自动化框架,而是一个仅用于图像验证的特定工具。
它也将允许您忽略图像的不稳定部分(随机数据等)
它将与您选择的任何其他 UI 测试框架集成:Selenium、Sikuli 等。

http://visualci.com

Let me suggestion another solution.
It's not a complete UI automation framework, but rather a specific tool just for the Image validation.
It will allow you to ignore the unstable part of your images as well (random data, etc.)
It will integrate with any other UI testing framework you choose:Selenium, Sikuli, etc.

http://visualci.com

羁〃客ぐ 2024-08-13 15:35:27

感谢您的评论!请看一下 RoutineBot – 基于点击某些图像模式的界面测试软件,并亲自看看这个想法是如何在一个
自动化工具!

thanks for your comment! please Take a look at RoutineBot – interface testing software based clicking on certain image patterns and see for yourself how this idea is implemented in an
automation tool!

安静被遗忘 2024-08-13 15:35:27

老问题,但也许这个答案可能对某人有用。我目前正在使用两种产品,

即 Automation Anywhere (http://www.automationanywhere.com/Testing/

和 HP Quick Test Professional(http://www8.hp.com/us/en/software-solutions/software.html?compURI=1172957#.UhJBwpLW5-k

两者都做得足够好,并且两者都支持使用图像识别。我并不完全相信图像识别本身就是一件坏事。与所有事情一样,您必须根据自己的特定需求定制方法,并使用适合工作的正确工具。

Old question, but perhaps this answer may prove useful to someone. I currently am using two products,

Testing Anywhere, by Automation Anywhere (http://www.automationanywhere.com/Testing/)

and Quick Test Professional, by HP (http://www8.hp.com/us/en/software-solutions/software.html?compURI=1172957#.UhJBwpLW5-k)

Both of them do the job well enough, and both support the use of image recognition. I am not entirely convinced that image recognition is in itself a bad thing. As with all things, you have to tailor your approach to your particular needs and use the right tool for the job.

淡淡の花香 2024-08-13 15:35:27

只是想我会在此线程中添加另一个条目。事情可能已经改变,不确定,但当我上次看到演示时,该产品提供了类似 Sikuli 的 IDE/界面/功能,同时作为商业产品,并支持模拟器之外的实际设备。不知道该工具现在是否已经改进,可以通过图像之外的标识符来检测对象。

请参阅 http://experitest.com 的测试

Just thought I'd add another entry to this thread. Things may have changed, not sure, but when I last saw the demo, this product offered Sikuli-like IDE/interface/capabilities while being a commercial product and supported actual devices beyond simulator. Don't know if the tool has improved to detect objects by identifiers beyond images now or not.

SeeTest from http://experitest.com

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文