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
43 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,050 points
60 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
118 views
0 votes
3 answers

How to specify "ENTER" button functionality in Selenium WebDriver code?

using OpenQA.Selenium.Interactions; Actions builder = new Actions(driver); ...READ MORE

answered Feb 12 in Selenium by anonymous
6,290 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,050 points
253 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
621 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
248 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
308 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
65 views