C# 什么是好的(如果有).NET Windows 自动化库?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2052915/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 23:02:47  来源:igfitidea点击:

What's a good, if any, .NET Windows automation library?

c#.netui-automation

提问by Abel

I'm looking for a library that can be used in native .NET code, just like any .NET assembly. The purpose of the library must be to automate Windows (push a button, select a window, send keys, record & playback, that sort of thing).

我正在寻找一个可以在本机 .NET 代码中使用的库,就像任何 .NET 程序集一样。该库的目的必须是使 Windows 自动化(按一个按钮、选择一个窗口、发送密钥、记录和回放,诸如此类)。

So: the library is supposed to be used natively in .NET, but the automation itself must be able to target any native or .NET Windows application that can receive user input.

所以:该库应该在 .NET 中本地使用,但自动化本身必须能够针对可以接收用户输入的任何本机或 .NET Windows 应用程序。



Suggestions so far:

到目前为止的建议:

If nothing else appears available, I'll probably choose Microsoft's UI Automation and upgrade any projects that require it that are still in .NET 2.0 to .NET 3.5, if possible. But I hope for a more widely applicable automation framework (.NET prior to 2.0 does not need to be supported).

如果没有其他可用的工具,我可能会选择 Microsoft 的 UI 自动化,并在可能的情况下将任何需要它但仍处于 .NET 2.0 中的项目升级到 .NET 3.5。但是希望有更广泛适用的自动化框架(2.0之前的.NET不需要支持)。

采纳答案by Unmesh Gundecha

Have you looked at the White framework?

你看过白色框架吗?

回答by pm100

microsoft's own built in one is fine

微软自己的内置是好的

http://msdn.microsoft.com/en-us/library/ms747327.aspx

http://msdn.microsoft.com/en-us/library/ms747327.aspx

not restricted to wpf as some seem to think.

不限于某些人认为的 wpf。

回答by benPearce

I have used AutoItin the past with success.

我过去曾成功地使用过AutoIt

回答by JasonTrue

I have used WebAii from ArtOfTestwith a fair degree of success in automating integration testing for a Silverlight app. It also supports WinForms and Web applications.

我已经使用了来自 ArtOfTest 的 WebAii,在为 Silverlight 应用程序自动化集成测试方面取得了相当程度的成功。它还支持 WinForms 和 Web 应用程序。

Microsoft UI Automation, the successor to Active Accessibility, can do almost all of the Windows UI automation you would need.

Microsoft UI 自动化是 Active Accessibility 的继任者,几乎可以完成您需要的所有 Windows UI 自动化。

回答by Chris Dunaway

This libraryis pretty interesting and is fairly simple. Perhaps it will help you.

这个库很有趣,也很简单。也许它会帮助你。

回答by t0mm13b

How about CSharpScript, here's an articleabout it on Codeproject, and here's the linkto the main website. Furthermore, it is familiar C#, scripted which can be used to automate anything.

CSharpScript 怎么样,这里有一篇关于 Codeproject的文章,这里是主网站的链接。此外,它是熟悉的 C# 脚本,可用于自动化任何事情。

Hope this helps, Best regards, Tom.

希望这会有所帮助,最好的问候,汤姆。

回答by Bill Agee

If you haven't seen it yet, and a commercial library is acceptable, you might check out Ranorex:

如果您还没有看过,并且可以接受商业图书馆,您可以查看 Ranorex:

http://www.ranorex.com/

http://www.ranorex.com/

I used Ranorex 1.5 quite a bit to write small C# UI automation utilities. It was pretty effective! Development seemed faster compared to using the MS UI Automation API directly, since Ranorex has a lot of useful convenience methods already available.

我经常使用 Ranorex 1.5 来编写小型 C# UI 自动化实用程序。这是相当有效的!与直接使用 MS UI 自动化 API 相比,开发速度似乎更快,因为 Ranorex 已经提供了许多有用的便捷方法。

I haven't used Ranorex 2 very much yet, though.

不过,我还没有经常使用 Ranorex 2。

In Ranorex 1.5, there was also support for traditional Win32 development in C++, but I didn't use it. As far as I know, that's still available in Ranorex 2.

在 Ranorex 1.5 中,也支持用 C++ 进行传统的 Win32 开发,但我没有使用它。据我所知,这在 Ranorex 2 中仍然可用。

I can't speak to the quality of the record/playback support in Ranorex since I never used that feature.

我无法谈论 Ranorex 中记录/播放支持的质量,因为我从未使用过该功能。

One final plus: Their support team was really responsive and helpful anytime I emailed them.

最后一个加分项:他们的支持团队在我给他们发送电子邮件的任何时候都非常敏感和乐于助人。

回答by Apoorv

I would still suggest FlaUIfor autoamating .Net Desktop,Mobile apps. Its based on Microsoft UIAlibraries and have support for external controls like the DevExpressGrid too Moreover, it is built on top of TestStack.Whiteso indeed a very good library and has a githubpage also

我仍然建议FlaUI自动化 .Net 桌面、移动应用程序。它基于 MicrosoftUIA库,并且也支持DevExpressGrid等外部控件此外,它建立在TestStack.White一个非常好的库之上,并且还有一个github页面