accessing frame through selenium and switching back to the original content
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.firefox.service import Service
service_obj = Service("C://Users//ancha//geckodriver-v0.33.0-win64//geckodriver.exe")
driver = webdriver.Firefox(service = service_obj)
driver.get("http://the-internet.herokuapp.com/iframe")
driver.switch_to.frame("mce_0_ifr")
driver.find_element(By.ID,"tinymce").clear()
driver.find_element(By.ID,"tinymce").send_keys("I am able to automate frame")
driver.switch_to.default_content()
print(driver.find_element(By.CSS_SELECTOR,"H3").text)
from selenium.webdriver.firefox.service import Service
service_obj = Service("C://Users//ancha//geckodriver-v0.33.0-win64//geckodriver.exe")
driver = webdriver.Firefox(service = service_obj)
driver.get("http://the-internet.herokuapp.com/iframe")
driver.switch_to.frame("mce_0_ifr")
driver.find_element(By.ID,"tinymce").clear()
driver.find_element(By.ID,"tinymce").send_keys("I am able to automate frame")
driver.switch_to.default_content()
print(driver.find_element(By.CSS_SELECTOR,"H3").text)
Comments
Post a Comment