Jump to content

Using AutoItX.dll in Visual Studio 2012 in Selenium test


Go to solution Solved by gritter,

Recommended Posts

Posted (edited)

This is a set-up issue.  I need to include everything for using AutoIt in the Visual Studio solution folder so it's portable.  I created a physical folder called "AutoItDLL" in the Test project of the application's solution file tree.  In it I copied AutoItX3.Assembly.dll, AutoItX3.Assembly.xml, AutoItX3.dll, AutoItX3_x64.dll, along with most of the other files in the original AutoItX folder in the Program Files from a different VM.

I created a reference to AutoItX3.Assembly.dll in my Test project.  In my C# class file where I want to use AutoIt, I added a "using AutoIt;" statement.

Within my function I tried to execute:

AutoItX.WinWaitActive("file Upload", "", 5);

AutoItX.Send(_filename);

AutoItX.Sent("{Enter"});

The first statement throw a DllNotFoundException, saying that it can't find AutoItX3.dll.

Like I noted above, AutoItX3.dll is in the same folder as the referenced AutoItX3.Assembly.dll within the Test project.

Where do I need to put AutoItX3.dll?  VS won't let create a direct reference to it?  Do I need to add it as existing file to the project?

#### Update #######

I tried moving AutoItX3.Assembly.dll, AutoItX3.dll and AutoItX3_x64.dll to the root folder of the Test project.  I recreated the reference to AutoItX3.Assembly.dll at the new location and I added the other 2 dll to the project as files. 

I got the same result...a DllNotFoundException, saying that it can't find AutoItX3.dll.

Edited by gritter
  • Solution
Posted

I just solved my problem myself.  I was so close the last time.

In addition to adding the 2 dll's to the project as files, I need to change their VS properties so they are copied to the output folder.  By default, they are not copied. 

Maybe most everyone already knows that.  I didn't.  IMHO, it would be a nice addition to the documentation.

  • 1 year later...

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...