0

I'm working with https://www.beatstars.com/dashboard.

Why does this work: action.key_down(Keys.CONTROL).send_keys('A').perform()

But this doesnt work: action.key_down(Keys.CONTROL).send_keys('0').perform()

The first is selecting all text (Control+A) and the second is resetting Chrome's zoom size (Control+0)

Any help would be greatly appreciated. Thank you.

  • 1
    Your actions are limited to the dom. (so browser controls are outside of Selenium's realm...) Select all, copy/paste are the exceptions... and maybe undo? The older webdriver versions used to allow much more, but at some point they limited things to the DOM. It's basically the same realm as client-side javascript. – pcalkins May 05 '22 at 19:39
  • Oh alright, that makes sense. Would you happen to know how to reset the zoom to 100%? ```driver.execute_script("document.body.style.zoom='100%'")``` isn't working for me for some reason. – THEMOUNTAINSANDTHESKIES May 05 '22 at 19:47
  • Doesn't seem like that would be accessible since it's a sort of global browser property... maybe check this for a workaround: https://stackoverflow.com/questions/18847432/zoom-body-browser – pcalkins May 05 '22 at 19:56

0 Answers0