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

Assertion for 3rd radio button is clicked

accessing frame through selenium and switching back to the original content

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