selenium-webdriverprotractor

How can we set zoom level in selenium/protractor i.e zoom to 90%


How can we set zoom level in selenium/protractor zoom page size to 90 percent etc


Solution

  • For Selenium:

    ((JavascriptExecutor)driver).executeScript("document.body.style.zoom='90%';");
    

    For Protractor:

    browser.executeScript("document.body.style.zoom='90%';");