Jump to content

Recommended Posts

Posted

Hi all.  I am new at test automation and struggling with something I inherited.  It is a Java project using Selenium code to run my test.  The test launches Firefox and uses an Autoit exe to handle the login prompt.  I use Eclipse as my IDE (probably meaningless) and Maven for packaging and executing my test. The test runs successfully when I launch it locally from eclipse with Maven goals of "clean install site".

I recently put my test/project into a Docker container (using "docker compose" to create the container) and am trying to run it a selenium grid ("Zalenium" to be more specific).  Now when I run my test from eclipse using maven "clean install site", it gets as far as opening Firefox in the selenium grid and the login window appears, but nothing happens after that; IE, the Autoit exe for the login seems to not function.  I've put in system.out's immediately before and after the call to the Autoit exe.  Since I see those system.out messages in my console, I am assuming the exe is being called - but I do not see the login credentials being typed in.  The test then fails at the next action where it tries to inspect the application home page and perform field input - because it never made it through the login.  There is nothing in the console output saying that the exe is "not found", but there is a message saying: "ERROR 10532 --- [ main] c.c.selenide.impl.PageSourceExtractor : org.openqa.selenium.UnhandledAlertException: Encountered unhandled user prompt dialog:".  I assume that the login dialog is the "alert" that is not being handled.

So since this works locally but not in my Docker/SeleniumGrid "environment:, my basic question is this:  Is an Autoit executable is compatible with Docker and/or Selenium grid?  And if so, is there some extra "configuration" needed?

Here is the Autoit script that is compiled into the executable.

Sleep(5000)

WinWaitActive("Authentication Required","","40")

If WinExists("Authentication Required") Then

Send($CmdLine[1]&"{TAB}")

Send($CmdLine[2]&"{Enter}")

Sleep(25000)

Exit

EndIf

And here is my Java/Selenium code to invoke the executable:

System.out.println("entering the Authenticate method");

sleep(5000);

Runtime.getRuntime().exec("src/main/resources/autoit/auth.exe " + id + " " + password);

System.out.println("exiting the Authenticate method");

 

I'm a newbie swimming in what feels like "the deep end", so thanks for bearing with any gaps in my request for help!  And thanks a ton for any insights!ere some extra "configuration" needed?

Posted

Thanks for responding.  It is an internal business application.  Here is the code that opens the website and then calls the method to authenticate using my Autoit "auth.exe".

      public void setUp() throws IOException, InterruptedException {

          open(https://myapp.aws.mycompanydomain.com/Home);

          authenticate();

          }

     private void authenticate() throws IOException, InterruptedException {

          System.out.println("entering the Authenticate method");

          sleep(5000);

          Runtime.getRuntime().exec("src/main/resources/autoit/auth.exe " + id + " " + password);

          System.out.println("exiting the Authenticate method");

          }

 

The Firefox browser opens and presents the login/authentication popup when running this with Docker and the Selenium Grid.  But unlike when I run locally, nothing appears to happen with the authentication box and then the test fails with the console info in my initial post.

Posted

More info to share and new question to ask... I was told that Autoit runs only on Windows.  If true, that might explain why it isn't working in Docker - because (so I am told) Docker runs a Linux OS.  Does anyone know if Autoit works on Linux?  Thanks again.

Posted

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