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

Getting email id from a child window and paste in parent window to login and catching the error message

For bypassing SSL and for running in headless mode

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