private IDisposable OpenWindow(Size?size, ShowWindowMode mode, WindowStartupLocation location) { var sizeTextBox = _session.FindElementByAccessibilityId("ShowWindowSize"); var modeComboBox = _session.FindElementByAccessibilityId("ShowWindowMode"); var locationComboBox = _session.FindElementByAccessibilityId("ShowWindowLocation"); var showButton = _session.FindElementByAccessibilityId("ShowWindow"); if (size.HasValue) { sizeTextBox.SendKeys($"{size.Value.Width}, {size.Value.Height}"); } modeComboBox.Click(); _session.FindElementByName(mode.ToString()).SendClick(); locationComboBox.Click(); _session.FindElementByName(location.ToString()).SendClick(); return(showButton.OpenWindowWithClick()); }