I am trying to enter data in prompt (URL Given), below codes is giving me an error. Please help me out with these?
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
import time
driver = webdriver.Firefox()
url = "http://the-internet.herokuapp.com/basic_auth"
driver.get(url)
time.sleep(5)
alert = driver.switch_to.alert
alert.authenticate('admin','admin')
time.sleep(4)
alert.accept()
I have tried with:
ActionChains(driver).send_keys("admin").send_keys(Keys.TAB).send_keys("admin").perform()
This one is also not working.
alert = driver.switch_to.alert() TypeError: 'Alert' object is not callable
– Scopolamine