Closed 82949712 closed 9 years ago
You just need to add this line into your Host class:
Instance.Application.Browser.Manage().Window.Maximize();
Thanks @sirj77
When I do this it does maximize the browser but that appears to cause subsequent test inputs to fail. Removing the maximize code the test works as expected but non-maximized. Is the below incorrect or maybe a different in Chrome now?
public static class Host
{
public static readonly SelenoHost Instance = new SelenoHost();
static Host()
{
var chromeOptions = new ChromeOptions();
Instance.Run("Hakata.Web", 6600, c => c
.UsingLoggerFactory(new ConsoleFactory())
.WithRemoteWebDriver(() => BrowserFactory.Chrome(chromeOptions))
.UsingCamera(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TestScreenShots"))
);
Instance.Application.Browser.Manage().Window.Maximize();
}
}
That should definitely work. Have you tried setting an explicit size rather than maximise to see if the same problem happens?
Also, what error does it fail with on the second test run?
Rob Moore | Readify Principal Consultant, Technical Specialist (Microsoft Azure) | m +61 400 777 763 | e rob.moore@readify.net | w readify.net
On 9 Sep 2016, at 7:46 AM, Geoff Hudik notifications@github.com wrote:
When I do this it does maximize the browser but that appears to cause subsequent test inputs to fail. Removing the maximize code the test works as expected but non-maximized. Is the below incorrect or maybe a different in Chrome now?
public static class Host { public static readonly SelenoHost Instance = new SelenoHost();
static Host() { var chromeOptions = new ChromeOptions(); Instance.Run("Hakata.Web", 6600, c => c .UsingLoggerFactory(new ConsoleFactory()) .WithRemoteWebDriver(() => BrowserFactory.Chrome(chromeOptions)) .UsingCamera(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TestScreenShots")) ); Instance.Application.Browser.Manage().Window.Maximize(); }
} — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
@robdmoore Not sure what changed but this seems to be working now. Thanks
It starts with a half sized window, can I start with a maximized window? Thanks