Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

selenium vba code to zoom out webpage to 60%

I am trying to zoom out webpage to 60% using below code.But this code is not working and also i am not getting any error.Please correct me where i am wrong.

below is my code:-

driver.ExecuteScript ("window.document.body.style.zoom = '60'")
like image 741
saransh Avatar asked Nov 26 '25 11:11

saransh


1 Answers

To zoom out the webpage to 60% you can use either of the following line of code :

driver.ExecuteScript "document.body.style.transform='scale(0.6)';"

or

driver.ExecuteScript "document.body.style.zoom='60%';"
like image 186
undetected Selenium Avatar answered Nov 28 '25 23:11

undetected Selenium