Mohamedasiq
Mohamedasiq

Reputation: 91

How to Set Page Zoom to 80% using Selenium webdriver. Using Javascript executor will reduce the Body tag only. Any other way?

I have a website which will auto hide the contents based on the resolution of the screen. All the contents of that website will be only shown if the Page Zoom is 80% and below only.

I have tried with actions, Javascript executor. Nothing works. Javascript executor is simply reduce the size of the elements inside the Body tag. So the resolution is not getting changed at all. Actions is not working at all.

new Actions(Driver) .SendKeys(html, Keys.Control + Keys.Subtract + Keys.Null).Perform(); new Actions(Driver) .SendKeys(html, Keys.Control + "-" + Keys.Null).Perform();

Upvotes: 2

Views: 959

Answers (1)

Alex Cap
Alex Cap

Reputation: 113

for chrome I may recommend you to try to add an option to run :

--enable-use-zoom-for-dsf

But I'm not able to check it now but it could help.

more info here: https://peter.sh/experiments/chromium-command-line-switches/#load-extension

Upvotes: 0

Related Questions