skip to Main Content

I am writing some automation in Selenium (Java) for an internal application which is quite old. I encountered something that I can’t solve with any tools in Selenium and with general Googling, nothing is coming up. I’m on a Mac (OS: macOS Ventura 13.3.1) using primarily Chrome, but the same thing happens on other browsers. This is a web application hosted on an internal server.

When the URL is passed to the browser on about:blank (see HTML below), a dialog box opens to accept login credentials (see attached image). However, there is no HTML document associated with the login which is loaded on the DOM. The browser’s main viewing panel is completely empty and the only thing in the DOM is about:blank.

<html>
  <head></head>
  <body></body>
</html>

You can see the login dialog box and interact with it directly by clicking in the username and password textboxes and clicking the buttons, however Selenium can’t interact with this object. One of the developers who works on that app said it was around before he started and he doesn’t even know how it works, but suspects it’s an ASP form of some kind running on "default browser, not a web page" and that it’s a .NET application (even though we are a Java shop)

Login dialog form

I Googled for nearly an entire day, to no avail. I created a custom Robot class for sending keys to it, but need to figure out how to target it. I’ve even tried sending ALT-TAB using Robot but it doesn’t target focus on the Username textbox, even though that textbox appears to have focus and a cursor in it.

Any thoughts or suggestions on how to identify this object and target it with automation tools would be much appreciated.

2

Answers


  1. Try this:

    String un = "<username>";
    String pwd = "<password>";
    // appending username, password with URL
    String url = "https://" + un + ":" + pwd + "@" + "<enter actual URL>";
    driver.get(url);
    

    Syntax:

    https://username:password@URL
    

    You don’t need to separately locate the username, password elements and action on it. The above code should ideally log you in.

    Login or Signup to reply.
  2. Well, asp.net does allow .net code to run and intercept requests BEFORE they are sent to web server for processing. (that’s part of how application pools are setup).

    So, often things like say a Image handler is created. These "things" thus run before IIS gets the request. Since that looks "much" like the windows domain logon, it most likely your authentication model being used here. (and that like other handlers can run before IIS gets the request – that’s how authentication handlers can be added to existing web sites).

    So, what authentication model is the site using? (look at web config – it should show this information). Are logons in database (say FBA (forms based authentication) or are these windows domain based? If you use windows domain based authentication, then quite sure the dialog is produced by the authentication system. (I mean, hit f12, browser debug tools – hover over that dialog – what does the markup show???).

    So, best guess is that dialog comes from the authentication being used – and looks to be windows authentication (windows domain) based.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search