I'm trying to write Login credentials using send_keys
element method with Selenium on this alert:
Login Alert
I get this alert after clicking on a button in a new window but I can't inspect the elements on this window.
here is my code
import time
import pynput
from selenium import webdriver
driver=webdriver.Chrome("C:/Users/dhias/OneDrive/Bureau/stgg/chromedriver.exe")
driver.get("http://10.15.44.177/control/userimage.html")
time.sleep(3)
window_before = driver.window_handles[0]
driver.maximize_window()
btn=driver.find_element_by_name("TheFormButton3")
btn.click()
window_after = driver.window_handles[1]
driver.switch_to.window(window_after)
obj = driver.switch_to.alert
time.sleep(2)
obj.send_keys('Admin')
time.sleep(2)
I get this error that tells me that there is no alert