'how do I zoom out the browser in robot framework

I am able to zoom out a page using

Execute javascript document.body.style.zoom="80%" this resizes the current page, and if I navigate to next page(or refresh) the zomm is reset to 100%

  • also decreasing the zoom using javascript introduces new errors(i.e the buttons move after the page has loaded)

and so, I want the Zoom to be set at Browser level (CTRL + "-").



Solution 1:[1]

@Vibhuti Salvi - you can use kw https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Set%20Window%20Size that will set window size, instead of js. This is more simple solution I think.

Solution 2:[2]

Set Window size will resize the browser window, it won't help to zoom in or zoom out. Below line can be used to zoom in/out the current browser window:

Execute javascript       document.body.style.zoom="80%"

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sujit Neb
Solution 2 Keivan