Running javascript commands inside a python file through selenium

 from selenium import webdriver

from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
chrome_options = Options()
chrome_options.add_experimental_option("detach", True)


service_obj= Service("C://Users//ancha//chromedriver_win32(4)")
driver = webdriver.Chrome(service=service_obj, options=chrome_options)
driver.implicitly_wait(2)
driver.get("https://rahulshettyacademy.com/AutomationPractice")
driver.execute_script("window.scrollBy(0,document.body.scrollHeight)")

Comments

Popular posts from this blog

accessing frame through selenium and switching back to the original content

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