Assertion to check that the text is not displayed when Hide button is clicked

 from selenium import webdriver

from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By

chrome_options = Options()
chrome_options.add_experimental_option("detach", True)
service_obj = Service("C://Users//ancha//chromedriver_win32(4)//chromedriver.exe")
driver = webdriver.Chrome(service= service_obj, options=chrome_options)
driver.get("https://www.rahulshettyacademy.com/AutomationPractice/")
assert driver.find_element(By.ID,"displayed-text").is_displayed()
driver.find_element(By.ID,"hide-textbox").click()
assert not driver.find_element(By.ID,"displayed-text").is_displayed()

Comments

Popular posts from this blog

accessing frame through selenium and switching back to the original content

Running javascript commands inside a python file through selenium