Browser Automation - Set page zoom on open

Is there any way to define the size/% the page is zoomed in by when opening a url?

You can with desktop automation using an addons for chrome to modify the zoom.

It’s very hard create macro like this but it’s possibile

Study this

https://ui.vision/x/desktop-automation

UI automation as suggested by @newuserkantu is of course one solution. Note that this can be done via XClick (image/OCR) or (easier in this case) use XType to send keyboard shortcuts to zoom in or out:

  1. Make everything larger: Windows and Linux: Press Ctrl and +. Mac: Press ⌘ and +. …
  2. Make everything smaller: Windows and Linux: Press Ctrl and -. Mac: Press ⌘ and -.
  3. Use full-screen mode: Windows and Linux: Press F11. Mac: Press ⌘ + Ctrl + f.

@sooshi Can I ask why you want to set the zoom level? Once I know this, maybe there is more elegant workaround :wink:

Hi @admin I kinda have same wish to set the zoom of window, because to my experience VisualVerify layouts only work at a consistent window zoom.
I selected the clip at 100% zoom, but sometimes my previous workspace was at 80% zoom and I may forgot to turn it back, therefore if there is a command we can adjust the zoom of window would be wonderful! :smiley:

Unfortunately the Chrome extension API does not give us access to change the zoom factor.

What you can do is to add an VisualAssert command at the top of the macro and make it fail when the zoom factor is not 100% - this way you are at least immediately alerted of the issue.

1 Like