cohhi / application-Test

软件测试
http://411.free.svipss.top/blog/resources/applicationtest/index.html
0 stars 0 forks source link

selenium不支持向prompt类型弹窗输入内容 #1

Closed cohhi closed 1 year ago

cohhi commented 1 year ago

puthon 3.5.0 selenium 3.141.0

cohhi commented 1 year ago
from selenium import webdriver
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.get("http://411.free.svipss.top/blog/resources/applicationtest/resources/steam-404/steam-404Selenium.html")
prompt = driver.find_element(by=By.ID, value="contendAlertMessage").click()
message = driver.switch_to_alert()
message.send_keys("ikun")
message.accept()
cohhi commented 1 year ago

已解决,向弹窗输入内容时不会显示。