Sign in to follow this  
Followers 0
daluu

AutoIt and .NET/C#/VB.NET

14 posts in this topic

#1 ·  Posted (edited)

I noticed there are some threads about using AutoIt with .NET, C#, or VB.NET by calling AutoIt as COM DLL, or as a C++ linked DLL.

I'd like to comment on this usage:

I like AutoIt and the best part about it is that it is free. However, it can be a hassle to work with it in .NET because of COM interop or having to add wrapper code to call it like a C++ DLL. And with COM there's also registration, unless you do reg-free COM.

Unless what you are automating is for commercial purposes (or maybe non-profit too), there is another option out there, because it is free for personal use. And if you can afford it, its not bad for commerce, it's cheaper than many QA GUI automation tools.

They also have a totally free spy tool for detecting GUI controls, that I (IMHO) think is better than AutoIt's window detection tool.

Now I'm not trying to advertise for them, just wanted folks to know there is an alternative, especially for personal projects. This tool is a lot easier to use for .NET. Also works for C++ and Python.

www.ranorex.com

Edited by daluu

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Yes, Ranorex is good. So is the White Project by Thoughtworks. And TestAutomationFX. And WebAii. And WatiN. And the UIAutomation Namespace in .NET 3.x. The list goes on. There have been a lot of advances in .NET Functional Testing Tools in the last couple of years.

If you're interested in creating your OWN framework, look at the ManagedAPI project, implement a WM_GETCONTROLNAME method, and you're off.

But I am so indebted to the AutoIt community for being the gateway drug into the seedy world of automation.

Thanks for your post, daluu.

Edited by zfisherdrums

Share this post


Link to post
Share on other sites

thanks for sharing your info. your managed API may be useful to me at some point. :)

Share this post


Link to post
Share on other sites

As a side note about this AutoIt - .NET topic, it would be nice if the AutoIt team could provide doc examples of how to call AutoIt from .NET (C# and/or VB.NET) using COM interop (and maybe Reg-Free COM?) and as a C++ DLL (forget whether that's considered static or dynamic).

This would surely help inexperienced developers using AutoIt and .NET.

Share this post


Link to post
Share on other sites

C++ can work through either static or dynamic calls. It all depends on how you link it.

Share this post


Link to post
Share on other sites

As a side note about this AutoIt - .NET topic, it would be nice if the AutoIt team could provide doc examples of how to call AutoIt from .NET (C# and/or VB.NET) using COM interop (and maybe Reg-Free COM?) and as a C++ DLL (forget whether that's considered static or dynamic).

This would surely help inexperienced developers using AutoIt and .NET.

Just curious, I've seen this referenced in one of your previous posts as well. How did it fail to meet your needs?

Zach...

Share this post


Link to post
Share on other sites

Just curious, I've seen this referenced in one of your previous posts as well. How did it fail to meet your needs?

Zach...

That does meet our needs but I was thinking it would be much better if this type of info was posted in the AutoIt website under the docs section. And would be nice if some code samples were posted on the site as well (either packaged with the AutoIt zip/exe download or as a separate sample apps package). After all, a VBScript sample is packaged with the AutoIt zip/exe package.

Having to look through the forum for this info takes more time, and may be harder to find.

Share this post


Link to post
Share on other sites

That does meet our needs but I was thinking it would be much better if this type of info was posted in the AutoIt website under the docs section. And would be nice if some code samples were posted on the site as well (either packaged with the AutoIt zip/exe download or as a separate sample apps package). After all, a VBScript sample is packaged with the AutoIt zip/exe package.

Having to look through the forum for this info takes more time, and may be harder to find.

yes,I have the same thoughts with you,I want to create DLL in AutoIT to be able to use the functions of AutoIT in other languages such as C ++...


no one

Share this post


Link to post
Share on other sites

I downloaded Ranorex, yea, it's impressive, but there's no documentation, and I, not being a programmer, have no clue how to deal with this object-oriented stuff.

What I like about AutoIt, is that it's simple and well-documented, if you need to do something - you open the help file and look for the function, and an example.

Now I couldn't find any way to access in controls inside .NET containers, especially grids... So I open Ranorex from time to time, try to do something with it, fail, and return to AutoIt. But I'll still need to deal with this .NET issue...

So either I find someone to teach me how to program in C# or someone who'll help me solve my problem using AutoIt... :P

Share this post


Link to post
Share on other sites

AutoIt does not play well with .Net as of right now. Only a handful of .Net objects are usable and they aren't exactly the most important.

Share this post


Link to post
Share on other sites

As this was one of the threads that I found when looking to embed AutoIt into a C# project that I was creating - I wanted to reply here and share the code that I've written that creates a C# AutoItHelper library class -- and has a example project that references said library, with a NotePad example call.

You can find the code and a brief intro on my blog at:

http://www.lancelarsen.com/Blog/tabid/72/E...er-Library.aspx

Regards...

...Lance Larsen

www.lancelarsen.com

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Hmm, I'd not seen the info about WM_GETCONTROLNAME before. That may be possible to slot into our advanced control syntax. I'll have a think about that.

Jon,

Please do consider it. I had raised a feature request in BugTrac to handle .NET control identification natively. Since I was able to implement the desired functionality using DllCall() ( and a whole lot of head-scratching ), the request was eventually closed. I completely understood the motivation for closing it. Frankly, it is only sheer laziness that I haven't re-written my solution as a UDF and submitted it for adoption. That said, implementing this into the native syntax (e.g. advanced control syntax) would be a welcome addition to the list of AutoIt functionality, integration issues notwithstanding.

Edited by zfisherdrums

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0