3

I am executing a test using Selenium, that is executed on 3 browsers in parallel. I want to position the windows the next way: left side, right side and bottom, So basically i'm looking for a command on Selenium that does the same effect as (start btn+left btn...)

I have tried using these commands:

driver.manage().window().setSize(new Dimension(800,650));
driver.manage().window().setPosition(new Point(0,0));

But the problem is that I need to enter the exact coordinates and when executing the test on different screens it might be a problem.

user3976173
  • 51
  • 1
  • 5

1 Answers1

0

First, try to get the screen resolution: Get and Set Screen Resolution

For example, if you want your window to be in the center of the monitor, and the monitor is let's say 1000px, then put the 1000px in a variable and set the window position to 1000px divided by 2, instead of 500 hard coded.

Community
  • 1
  • 1
Happy Bird
  • 1,012
  • 2
  • 11
  • 29