1

I want to Know All ways to do that used to zoom in and zoom out? selenium - chrome driver - python 3

I wish anyone can help me and list all the way (methods) to zoom in or zoom out to try it

I think the press (ctrl) + (+) can do what I want so how to send these two keys at the same time?

i wish anyone can help me.

NourEldin Osama
  • 137
  • 3
  • 8

1 Answers1

1

Alternate way would be using ActionChains

Its not definitive to 50%, but can be configured how many times we need to press(+/-) to get get desired zoom

from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys

action = ActionChains(driver)
action.key_down(Keys.CONTROL).send_keys('+').key_up(Keys.CONTROL).perform() #WindowsOS
action.key_down(Keys.COMMAND).send_keys('+').key_up(Keys.COMMAND).perform() #MacOS
Anmol Parida
  • 672
  • 5
  • 16