Sign in to follow this  
Followers 0
Arunsomu

HTTP authentication dialog is not recognized

2 posts in this topic

Hi All

I automate my web application using Selenium Where I got struck with HTTP authentication dialog.I used AutoIt to overcome this. See the below script which I use. There are two fields. One for user name (Edit2), another one for password (Edit3) and OK button (Button2).When I run the script it opens up the website as well as authentication dialog. But the user name & password are not entered. Can anyone please give your suggestions to make this work?

#include <IE.au3>

#Region Vars

$o_Addy = "http://myurl.com/"

$user = "name"

$pass = "password"

#EndRegion Vars

#Region Controls

#cs

Login window vars

When using the AU3Info tool the class of the login window is $Class.

The $ctrlU thru $ctrlS is the "ClassnameNN" for each textbox and button on the login window.

#ce

$Class = "[CLASS:#32770]"

$ctrlU = "Edit2"

$ctrlP = "Edit3"

$ctrlS = "Button2"

#EndRegion Controls

#Region Navigation to login prompt

$o_IE = _IECreate()

_IENavigate($o_IE, $o_Addy, 0)

#EndRegion Navigation to login prompt

;wait for 5 seconds for login window.

Sleep(5000)

#Region Control the login window

ControlSend($Class, "", $ctrlU, $user)

ControlSend($Class, "", $ctrlP, $pass)

ControlClick($Class, "", $ctrlS, "")

MsgBox(0, "Finished", "Bob's your uncle")

#EndRegion Control the login window

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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