robotframework-browser icon indicating copy to clipboard operation
robotframework-browser copied to clipboard

Window Size

Open Houbein opened this issue 1 year ago • 2 comments

Describe the bug The viewport argument of New Context does not work. According to the documentation; the New Context keyword has an argument viewport that allows you to set the width and hight to 0 so it will scale automatically with the window. This does not happen. If I set these values to 0, all I get is a tiny window that does not scale at all. To Reproduce Steps to reproduce the behavior:

  1. New Browser browser=chromium
  2. New Context with viewport={'width': '0', 'height': '0'} *Expected behavior A browser window that detects my window size and automatically scales to that size.

Desktop (please complete the following information):

  • OS: [Wihndowsw 10 22H2 19045.5011]
  • Browser Chrome]
  • Version [130]

Houbein avatar Oct 25 '24 15:10 Houbein

@allcontributors please add @Houbein for bugs

aaltat avatar Oct 25 '24 20:10 aaltat

@aaltat

@Houbein already contributed before to bug

allcontributors[bot] avatar Oct 25 '24 20:10 allcontributors[bot]

Does it behave differently than in this video? I tried it and it works exactly as expected.

Yes the window is small, but if you resize the window, the viewport resizes/scales together with the outer size.

https://github.com/user-attachments/assets/da8b0e43-d341-4f99-a494-07c1b3767d0d

Viewport is window.innerWidth and window.innerHeight . The window that you as a user might resize is window.outerWidth and window.outerHeight.

With a fixed viewport the page always has the same size independently of the screen size. This can also be bigger than the outer size.

If your seen behaviour is still a different one, please describe more.

Snooz82 avatar Nov 03 '24 21:11 Snooz82

Ah, I'm sorry I misinterpreted the documentation to mean that with viewport 0 it would always open scaled to the full resolution of my browser.

Houbein avatar Nov 07 '24 10:11 Houbein

@Houbein

you may also want to look at #2054

you can set the viewport to ${NONE} and give the following argument to New Browser args=["--start-maximized"]

Snooz82 avatar Nov 07 '24 14:11 Snooz82

image

T1B07 avatar Jan 15 '25 06:01 T1B07