Arunsomu Posted December 6, 2010 Posted December 6, 2010 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
KaFu Posted December 6, 2010 Posted December 6, 2010 (edited) Take a look at my for another way around Basic Auth in IE. Edited December 6, 2010 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now