/// <summary> /// Get a Chrome driver setup with emulation /// </summary> /// <returns>A Chrome driver</returns> private IWebDriver EmulateiPhone() { ChromeOptions options = new ChromeOptions(); options.EnableMobileEmulation("iPhone 8"); return(WebDriverFactory.GetChromeDriver(SeleniumConfig.GetCommandTimeout(), options, "DEFAULT")); }
public void SetName() { if (SeleniumConfig.GetBrowserName().Equals("Remote", System.StringComparison.CurrentCultureIgnoreCase)) { try { string name = TestContext.FullyQualifiedTestClassName + "." + TestContext.TestName; RemoteBrowserType remoteBrowser = SeleniumConfig.GetRemoteBrowserType(); string remotePlatform = SeleniumConfig.GetRemotePlatform(); string remoteBrowserVersion = SeleniumConfig.GetRemoteBrowserVersion(); Dictionary <string, object> capabilities = SeleniumConfig.GetRemoteCapabilitiesAsObjects(); capabilities.Add("build", Environment.GetEnvironmentVariable("SAUCE_BUILD_NAME")); capabilities.Add("name", name); capabilities.Add("extendedDebugging", Config.GetValueForSection(ConfigSection.SeleniumMaqs, "extendedDebugging")); var options = WebDriverFactory.GetRemoteOptions(remoteBrowser, remotePlatform, remoteBrowserVersion, capabilities); this.WebDriver = new RemoteWebDriver(SeleniumConfig.GetHubUri(), options.ToCapabilities(), SeleniumConfig.GetCommandTimeout()); } catch (Exception e) { Log.LogMessage(MessageType.WARNING, "Failed to set Sauce name because: " + e.Message); } } }