Reputation: 99
I'm currently using:
options.EnableMobileEmulation("Nexus 5");
To emulate a mobile version of a website, but ChromeDriver window doesn't readjust the size to fit Nexus 5's dimensions so I'm left with half a blank page.
Example:
I want window size to fit the content of the site rather than producing empty page content.
Upvotes: 3
Views: 171
Reputation: 6459
Try the following code:
System.Drawing.Size window_size = new System.Drawing.Size(x, y);
driver.Manage().Window.Size = window_size;
where x, y: width and height in pixels.
Hope it helps you!
Upvotes: 3