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,320 points
678 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,910 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 28, 2018 in Selenium by nsv999
• 5,500 points
921 views
0 votes
1 answer
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 16, 2019 in Selenium by Raishul
3,638 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, 2019 in Selenium by Abha
• 28,140 points
1,362 views
0 votes
2 answers

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,500 points
12,754 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
8,623 views
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,910 points
6,697 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,561 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,910 points
1,875 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,910 points
1,580 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP