My Windows authentication code no longer working now

0 votes

Note: The same code works well earlier, but now it's not working. My below code for windows authentication was working well for over a year. But for the last few days it is longer working now. I am not able to identify exact reason for that.

from selenium import webdriver

import time

import win32com.client

driver=webdriver.Chrome('D:/Software/BrowsersDriver/ChromeDriver/chromedriver.exe')

driver.maximize_window()

driver.get("authentication windows url")

shell = win32com.client.Dispatch("WScript.Shell")   

shell.Sendkeys("username")  

time.sleep(1)

shell.Sendkeys("{TAB}")

time.sleep(1)

shell.Sendkeys("password") 

time.sleep(1)

shell.Sendkeys("{ENTER}")

time.sleep(5)

driver.quit()

2018-04-02 07:09:28,230 INFO: Imported existing <module 'comtypes.gen' from 'C:\Python27\lib\site-packages\comtypes\gen\__init__.pyc'>

2018-04-02 07:09:28,230 INFO: Using writeable comtypes cache directory: 'C:\Python27\lib\site-packages\comtypes\gen'

. I am using python 2.7.12 and latest version of chrome driver.

Jun 12, 2018 in Selenium by Martin
• 4,220 points
62 views

1 answer to this question.

0 votes

Try below of the options

driver.switchTo().alert();

or

driver.switchTo().activeElement();

before typing credentials?

answered Jun 12, 2018 by Samarpit
• 5,130 points

Related Questions In Selenium

0 votes
1 answer

Not able to use “explicit wait” in my code

To wait until the entire data has ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,110 points
94 views
0 votes
0 answers

How to hover element when action class is not working in my Selenium framework ?

When i am writing the code to ...READ MORE

Feb 15 in Selenium by Raishul
545 views
0 votes
1 answer

unable to launch my first code in eclipse using selenium chrome driver

@klbret, can you share your code or ...READ MORE

answered Oct 10 in Selenium by Abha
• 27,180 points
55 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,110 points
908 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
1,098 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
831 views
0 votes
1 answer

Test fail: Selenium Python send_keys stop working

Your chrome driver should be latest version ...READ MORE

answered May 16, 2018 in Selenium by Samarpit
• 5,130 points
412 views
0 votes
1 answer

Identifying the page iframe in Selenium using Java Code

Open the page in a browser and ...READ MORE

answered May 24, 2018 in Selenium by Samarpit
• 5,130 points
136 views