Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 868
Milan Kumar Avatar asked Dec 25 '22 21:12

Milan Kumar


1 Answers

Dont know whether an equivalent is there in protractor (since never worked), but this is how I would zoom-in and out in java webdriver via JavascriptExecutor using:

document.body.style.transform='scale(0.9)'

where 0.9 is scale percentage. Though for zoom u can also use

document.body.style.zoom='90%'

but this won't work on firefox and opera. Hope this could be helpful.

like image 166
Vivek Singh Avatar answered Apr 17 '23 18:04

Vivek Singh