Assertion for 3rd radio 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/")
radios = driver.find_elements(By.CSS_SELECTOR, ".radioButton")
radios[2].click()
assert radios[2].is_selected()

Comments

Popular posts from this blog

accessing frame through selenium and switching back to the original content

For bypassing SSL and for running in headless mode