1

I am developing an application and I need to send some info about the resolution of a browser's window and the resolution of a monitor.

The resolution is currently set to: 1920x1080. I want to send 800x600 as the resolution of the desktop.

Here's an example:

The desktop resolution is 800x600 and I set the chrome browser resolution to 480x320. I do this with the following snippet of code:

driver.Manage().Window.Size = new Size(480, 320);

How I can do this with Selenium? How can I properly send this info?

dbc
  • 104,963
  • 20
  • 228
  • 340
Kirill KZ
  • 71
  • 5
  • I tried to reword your question, can you first see if it makes sense. If not I can rollback my edits. Also, can you see if this helps you: http://stackoverflow.com/questions/15397483/how-do-i-set-browser-width-and-height-in-selenium-webdriver – JonH Jun 24 '16 at 18:44
  • Thanks. Everything is right. I found decision of my problem, but it for Firefox: https://www.browserstack.com/automate/c-sharp – Kirill KZ Jun 24 '16 at 18:48
  • If you found an answer to your question, please post it as an answer and accept it. Thanks. – JeffC Jun 24 '16 at 18:53
  • I found a decision using other browser. I work with Chrome, but found for FF. – Kirill KZ Jun 24 '16 at 19:21

1 Answers1

1

This is pretty straightforward now with Chrome. Just do the following:

ChromeOptions displayOptions = new ChromeOptions();
options.addArguments("--start-maximized");
driver = new ChromeDriver(displayOptions);  
//  Initialize your driver object here.
IWebDriver chromeDriver = new ChromeDriver("path to driver here", displayOptions);

This will initialize the driver object to be full-screen when it is instantiated.

Brian
  • 5,069
  • 7
  • 37
  • 47