Zoom in Chrome

Hi, I am trying to zoom in Chrome. The Website I would like to test needs to have a Zoom-Level of approx. 80%.

I already tried:

WebUI.executeJavaScript("document.body.style.zoom='XY%'", null)

But this does not work.

Can anyone help?
Thank you!

hello,
any error, how it behaves, are you able to set zoom manually on app?

Hi Andrej,

no error appears when running the test with the command. I am not testing an app but a website and this I can zoom manually.

by app i meant website.
can you please post snipplet how your code looks like?

Yes! This is the part of the Code. As I said, I try to run this in Chrome

WebUI.openBrowser(’’)

WebUI.maximizeWindow()

WebUI.navigateToUrl(‘http://’)

WebUI.delay(1)

WebUI.executeJavaScript(‘document.body.style.zoom=\‘zoom 80%\’’, null)

WebUI.delay(1)

use

WebUI.executeJavaScript('document.body.style.zoom=\'80%\'', null)

2 Likes

Thank you - this one worked for me.