How to send CTRL + Shift + I in selenium using ActionChains. I followed many examples such as:
Web Driver API | 7.2. Action Chains
For Selenium with Python, how can i get it to press CTRL, SHIFT, i?
But, those don't work for me. I don't know, what I missed. Maybe because I using a different script. Please help me to send CTRL + Shift + I.
I re-use existing Selenium browser. I was trying to use Action Chains and select an element. But, both are not working without any error logs.
def secondProccess(executor_url, session_id, data):
options = Options()
options.page_load_strategy = 'normal'
options.add_argument("--disable-infobars")
options.add_argument("--enable-file-cookies")
capabilities = options.to_capabilities()
driver = webdriver.Remote(command_executor=executor_url, desired_capabilities=capabilities)
driver.close()
driver.session_id = session_id
link="https://google.com"
driver.execute_script("window.open('{}');".format(link))
action = webdriver.ActionChains(driver)
## Trying to use ActionChains
action.send_keys(Keys.CONTROL, Keys.SHIFT, 'i').perform()
## Trying to use ActionChain key down
action.key_down(Keys.CONTROL).key_down(Keys.SHIFT).send_keys("i").perform()
## Trying to use element
driver.find_element_by_tag_name('body').send_keys(Keys.CONTROL, Keys.SHIFT, 'i')
sys.exit()