Sign in to follow this  
Followers 0
Chupakabr

Calling custom script from c#

5 posts in this topic

Hello,

I found some useful scripts which I want to use in my c# project. So I wondering if there is a way to make some wrapper for any custom script and then reference it or import as dll (similar to AutoItX.dll)?

Share this post


Link to post
Share on other sites



Nope. The only way to use the script is to translate it to C#. All of the functions in AutoIt can be rewritten in C# if you know both languages well enough.

There is no direct way to use a script in another language though.

Share this post


Link to post
Share on other sites

Sure this is only matter of time to rewrite smth from one language to other, but that will ruin the whole point.

Maybe I don't get a clue yet but if AutoItX.dll exists and it based on AutoIt scripts, then there should be some standard mechanism to translate script to dll. Otherwise it will be some other separate project like White or Test Automation FX. So AutoIt developers have such mechanism but do not want to share it or maybe this will be a feature in future releases, is this correct?

I just starting with AutoIt and my point is to use scripts in tight coupling with C# so I'll use all benefits of OOP, debug, logging, etc. and simultaneously use benefits of the scipting language.

Share this post


Link to post
Share on other sites

Looks like it will not be possible because developers are not intrested in such feature. Does anyone know why? rejected ticket

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Hello, Chupakabr;

AutoItX.dll is not based on interpreted AutoIt scripts, per se. AutoItX shares a similar API, though not as feature complete. I am not a developer on this project, so I cannot assume their motives, but it is hard for me to imagine that they are "purposefully" hiding capabilities like what you are asking for. I would think they have a particular vision for what AutoIT is intended for, and model-based test automation/DLL creation was not a driving requirement.

You mention White and AutomationFX, so I'll assume you are in the .NET domain. If you want to use the the AutoIT API in an object-oriented fashion, I'm afraid you only have one choice: Interop the AutoItX.dll and re-write the scripts/model in your environment.

I've built physical object models of the AUT using AutoItX using Michael Hunter's Automation Stack concept. But when I started looking into White - and saw that it allowed me to pretty much stay 100% .NET - I gave serious thought as to why I using AutoITX to accomplish the same thing.

I'd love to talk more about this stuff, but don't want to junk up your topic. PM if you wish to discuss more. I personally would like to hear more about what you're testing, how you're approaching it, and why you think AutoIt may/may not be the best choice for your situation.

Anyway, I hope this helps your journey.

Zach...

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