开发者

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

开发者 https://www.devze.com 2022-12-16 00:32 出处:网络
I\'m looking for a library that can be used in native .NET code, just like any .NET assembly. The purpose of the libr开发者_如何转开发ary must be to automate Windows (push a button, select a window, s

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

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.


Suggestions so far:

  • benPearce suggested AutoIt. It has a DLL, which is native Win32 but not native .NET and cannot be used without use of .NET Interop.
  • Chris Dunaway suggested Global Mouse Keyboard Lib. This came closest, but is not an automation lib. It just helps setting up keyboard and mouse hooks.
  • pm100 suggested Microsoft's WPF UI Automation. This one is pretty good, albeit that it's not available if you develop in .NET 2.0 and it requires the WPF to be installed on the system. It can, however, automate everything from Win32 apps to HTML in a browser.
  • JasonTrue suggested WebAI from ArtOfTest. This is a testing framework mainly geared towards browsers and web applications. It is unfortunately not well suitable for use for Windows automation.

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).


Have you looked at the White framework?


I have used AutoIt in the past with success.


microsoft's own built in one is fine

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

not restricted to wpf as some seem to think.


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

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.

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

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.

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

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


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


Check out Tools for automated GUI testing on windows


I would still suggest FlaUI for autoamating .Net Desktop,Mobile apps. Its based on Microsoft UIA libraries and have support for external controls like the DevExpress Grid too Moreover, it is built on top of TestStack.White so indeed a very good library and has a github page also


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

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


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

Hope this helps, Best regards, Tom.

0

精彩评论

暂无评论...
验证码 换一张
取 消