I am starting learn automation with python + selenium and I have the problem: When I use any of this scripts:
self.driver.execute_script("document.body.style.transform = 'scale(0.8)'")orself.driver.send_keys(Keys.CONTROL, Keys.SUBTRACT)orwebdriver.ActionChains(driver=webdriver.Chrome()).key_down(Keys.CONTROL).send_keys("-").perform()
my test site is scaling incorrectly - the scale does not decrease, but the page with empty borders along the edges just moves away and the layout crasheds (last script doesnt work and doesnt stopped with error). Give me the best way for this case, please.
P.S. Method by browser settings:
driver.get('chrome://settings/') driver.execute_script('chrome.settingsPrivate.setDefaultZoom(0.8)') driver.get("https://www.stackoverflow.com/")
works wery well, but in this case Selinium doesnt works corretly with all pages - it can't to choose a locators..