Jump to content

AutoitX not working, Trend and possible alternatives?


frankh
 Share

Recommended Posts

I understand that AV software is a problem in relation to AutoIt.

I've been using the C# and Java AutoItX3/4 libraries for months now, and been really happy with it (except some unstability where the project/solution suddenly needs to be cleaned and rebuilt due to the AutoIt libraries suddenly "disappearing").

But now it's suddenly stopped working, and the only plausible explanation I can find is a Trend AV (or possibly Windows) update. It happened after a reboot and update, and there were absolute zero changes to the code or implementations between when everything was working and when it suddenly stopped.

I don't have the option of disabling the AV software, so there's little I can do in that regard, I think. I have added all the existing AutoItX files to the exception list in Trend, but that doesn't help.

So I'm left with considering alternatives, but I haven't come across any. Are there any alternatives to AutoItX in VS/C# and Eclipse/Java? I have no need for the AutoIt application and scripting; I only need to use the libraries in my C#/Java code.

What I'm using it for is accessing a browser login prompt in a project/solution using Selenium to automate web pages. The site authentication doesn't work with normal http auth (http://username:password@url). Are there any other ways, in Visual Studio and C#, to access and handle this login window?

Link to comment
Share on other sites

What do you mean? I'm using the AutoItX dll in C#. That's like saying that C++ is better than MS Word, or that bananas are better than apples.

Are you able to do what I'm describing in C#, using something else than AutoItX? That is, access an open login prompt for a web site and enter username, password etc.? If so, what library are you using?

Link to comment
Share on other sites

you can use NuGet to get the Selenium packages for C#. There isn't much C# can't do and that's all I have to say.

http://executeautomation.com/blog/referencing-selenium-c-in-visual-studio/

 

Selenium Automation with C#

http://executeautomation.com/blog/functional-tools/selenium-automation-with-c/

Selenium IDE can easily export a C# script recording you logging into the website too.

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

Ok, there's obviously some information I forgot to provide here:

NB: There WAS no Windows update according to the log. And removing the AV software didn't help, either.

I AM using C# (Visual Studio 2015 Ent.), and I AM using Selenium. Selenium is a browser automation tool, and have no way to access a browser login window, since that is an OS (Windows) element.

Also, the site in question does not use standard http authentication. It sends some authorization tokens back and forth, and because of this webrequest (or just entering http://user:pass@url) does not work. This is not a question - it's a fact. For this reason, the authentication MUST be done at GUI level. Selenium cannot handle the login.

Hence, I've been using AutoItX - in C#, together with Selenium - for automation. AutoItX only does ONE thing: Access the login prompt, enter user/pass and hit Enter. Selenium automates everything after this.

Now, for no reason I've been able to find, NO applications or solutions, in either VS/C# or Eclipse/Java, that uses AutoItX works. There are no errors; AutoItX simply does not do what it did yesterday, before rebooting the computer.

Edited by frankh
Link to comment
Share on other sites

maybe try registering the dll if it needs to be registered? it does sound like your environment is not really stable if things just stop working. I'll do some testing with the DLL. I've not ever really had need for it before.

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

I don't see why that would help? The assembly and dll files are included in the solution/project, and there are no errors related to them. And, most important: Not a single change has been made anywhere in the code or implementation between it working like a charm and not working at all.

Also, registering the dll in windows is not a good way to do this imo. And it's really unnecessary.

Of course, there HAS to be something that's changed somewhere in Windows - I don't see how this can happen otherwise. But I also cannot see any way to troubleshoot this. And I've not been able to find a good alternative to AutoItX either.

Edited by frankh
Link to comment
Share on other sites

https://raveendran.wordpress.com/2012/06/15/how-to-installregister-autoitx3-dll/

  • Steps to install/register AutoItx3.dll file in windows machine:
  • 1. Download AutoItX3.dll file from the link http://www.2shared.com/file/6zR7bTlq/AutoItX3.html
  • 2. After download completes, Copy & paste it in c:\autoit\PASTE HERE (c:\autoit\AutoItX3.dll)
  • 3. Open Command Prompt as an ‘Adminstrator’
  • 4. In Command Prompt>cd c:\windows\systems32 [Press Enter]
  • 5. c:\windows\systems32>regsvr32 c:\autoit\AutoItX3.dll [Press Enter]
  • 6. Prompt will appear with message “registration Succeeded

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

Well, as I said: That's really not necessary, and it's not a good practice for development, since you tie the .dll to the specific machine.

I could do it just for troubleshooting, of course. But I'm willing to bet a lot of money, beer or whatever that it won't do any good.

Link to comment
Share on other sites

good luck. I might try to go back to a restore point if you are all backed up. there is not much to do but guess. we can't have hands on to your system and files, etc.. and you may THINK nothing changed, but somewhere, something did. good luck.

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

do you think it possible that your company is blocking it with Group Policy? For security reasons?

thanks, now you got me roped into this. I am putting together a little C# AutoitX test now... lol all because I am curious

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

Well, I don't see how it could block AutoItX from accessing the GUI elements when it's already loaded? The C# project loads the .dll and assembly, and there are no errors related to that. But of course, since I'm completely dumbfounded as to the reason for this, more or less any reason that I cannot eliminate is possible.

EDIT: I tried registering the .dll in Windows (as you mention above). Didn't change anything.

Edited by frankh
Link to comment
Share on other sites

Well, it should work, unless you're unlucky. Before it suddenly stopped working, I've been impressed by how well it worked. Except some unstability where the library suddenly disappears in VS, but that might also be a VS thing (however, seeing how much trouble is related to AutoIt, I doubt it).

Link to comment
Share on other sites

ok. just whipped up a sample in VS 2017. I used NuGet to get AutoItX.Dotnet

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AutoIt;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            // Wow, this is C#!
            AutoItX.Run("notepad.exe", "", 1);
            AutoItX.WinWaitActive("Untitled");
            AutoItX.Send("I'm in notepad");
            IntPtr winHandle = AutoItX.WinGetHandle("Untitled");
            AutoItX.WinKill(winHandle);
        }
    }
}

this works great. can you think of some testing I might do to try to troubleshoot?

 

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

oh! you have VS 2015 Ent? then you can do the automation using the special test projects!!! You can just record it and it will save it in C# for you. it is called Coded UI project

Edited by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
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
 Share

  • Recently Browsing   0 members

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