Alert box, Pop Up - Selenium Automation with Python, Pycharm IDE
Alert box Pop Up - Selenium Automation with Python, Pycharm IDE
Click See More for the code:
Code Starts Here - - - - - - - - - - - - - - - - - - - - *- - - - - - - - - - - - - - - -
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
driver = webdriver.Chrome(executable_path="C:/Program Files (x86)/Google/Chrome/Application/chromedriver.exe")
driver.get("file:///G:/trikam/Alert.html")
driver.find_element_by_xpath("/html/body/div[2]/div/button").click()
time.sleep(5)
#driver.switch_to_alert().accept() # closes alert window using ok button
driver.switch_to_alert().dismiss() # closes alert by using cancel button
Видео Alert box, Pop Up - Selenium Automation with Python, Pycharm IDE автора Питон и будущее программирования
Видео Alert box, Pop Up - Selenium Automation with Python, Pycharm IDE автора Питон и будущее программирования
Информация
3 декабря 2023 г. 1:45:19
00:01:15
Похожие видео