/// <summary> /// A new browser session. Control the lifecycle of this session with using{} / session.Dispose() /// </summary> /// <param name="SessionConfigurationconfiguration for this session</param> /// <returns>The new session</returns> public BrowserSession(SessionConfiguration SessionConfiguration) : this(new ActivatorDriverFactory(), SessionConfiguration, new RetryUntilTimeoutRobustWrapper(), new StopwatchWaiter(), new WebClientWithCookies(), new FullyQualifiedUrlBuilder()) { }
public string GetFullyQualifiedUrl(string virtualPath, SessionConfiguration sessionConfiguration) { var scheme = sessionConfiguration.SSL ? "https" : "http"; var baseUrl = sessionConfiguration.Port == 80 ? String.Format("{0}://{1}", scheme, sessionConfiguration.AppHost) : String.Format("{0}://{1}:{2}", scheme, sessionConfiguration.AppHost, sessionConfiguration.Port); return new Uri(new Uri(baseUrl), virtualPath).AbsoluteUri; }
public void Setup() { config = new SessionConfiguration { AppHost = "coypuspc.azurewebsites.net", Browser = Browser.Firefox }; browser = new BrowserSession(config); }
public string GetFullyQualifiedUrl(string virtualPath, SessionConfiguration sessionConfiguration) { var scheme = sessionConfiguration.SSL ? "https" : "http"; var userInfoPart = string.IsNullOrEmpty(sessionConfiguration.UserInfo) ? "" : sessionConfiguration.UserInfo + "@"; var baseUrl = sessionConfiguration.Port == 80 ? String.Format("{0}://{1}{2}", scheme, userInfoPart, sessionConfiguration.AppHost) : String.Format("{0}://{1}{2}:{3}", scheme, userInfoPart, sessionConfiguration.AppHost, sessionConfiguration.Port); return new Uri(new Uri(baseUrl), virtualPath).AbsoluteUri; }
/// <summary> /// A new browser session. Control the lifecycle of this session with using{} / session.Dispose() /// </summary> /// <param name="SessionConfigurationconfiguration for this session</param> /// <returns>The new session</returns> public BrowserSession(SessionConfiguration SessionConfiguration) : this(new ActivatorDriverFactory(), SessionConfiguration, new RetryUntilTimeoutTimingStrategy(), new StopwatchWaiter(), new WebClientWithCookies(), new FullyQualifiedUrlBuilder(), new FinderOptionsDisambiguationStrategy()) { }
public static SessionConfiguration GetSeesionDetails() { SessionConfiguration config = new SessionConfiguration(); config.AppHost = "localhost:56731"; config.Port = Int32.Parse("101"); config.Driver = typeof(Coypu.Drivers.Selenium.SeleniumWebDriver); config.Browser = Coypu.Drivers.Browser.InternetExplorer; return config; }
public void CheckSimplePageLoad() { var sessionConfiguration = new SessionConfiguration { AppHost = "teamaton.com", Browser = Browser.HtmlUnitWithJavaScript, }; var browserSession = new BrowserSession(sessionConfiguration); browserSession.Visit("/"); Assert.That(browserSession.HasContent("building web applications that work")); }
public void SetUp() { var configuration = new SessionConfiguration { Driver = typeof(SauceLabsDriver) }; var desiredCapabilites = new DesiredCapabilities("chrome", "46", Platform.CurrentPlatform); desiredCapabilites.SetCapability("platform", "Windows 7"); desiredCapabilites.SetCapability("username", "sebllabres"); desiredCapabilites.SetCapability("accessKey", "892fdc2f-7409-4979-a592-e5e3d3ee73bc"); desiredCapabilites.SetCapability("name", TestContext.CurrentContext.Test.Name); _driver = new SauceLabsDriver(Browser.Parse(ConfigurationSettings.AppSettings["browser"]), desiredCapabilites, new CustomRemoteDriver(new Uri("http://ondemand.saucelabs.com:80/wd/hub"), desiredCapabilites)); _browserSession = new BrowserSession(configuration, _driver); _browserSession.MaximiseWindow(); }
public string GetFullyQualifiedUrl(string virtualPath, SessionConfiguration SessionConfiguration) { if (Uri.IsWellFormedUriString(virtualPath, UriKind.Absolute)) return virtualPath; virtualPath = virtualPath.TrimStart('/'); var scheme = SessionConfiguration.SSL ? "https" : "http"; return SessionConfiguration.Port == 80 ? String.Format("{0}://{1}/{2}", scheme, SessionConfiguration.AppHost, virtualPath) : String.Format("{0}://{1}:{2}/{3}", scheme, SessionConfiguration.AppHost, SessionConfiguration.Port, virtualPath); }
public static void Start() { var sessionConfiguration = new SessionConfiguration { AppHost = "localhost/lateseats", Port = 80, Driver = typeof(SeleniumWebDriver) }; Browser = new BrowserSession(sessionConfiguration); Browser.MaximiseWindow(); ScenarioContext.Current.Add("Browser", Browser); }
private static BrowserSession CreateNewBrowserSession() { BrowserSession browser; var configuration = new SessionConfiguration { Timeout = TimeSpan.FromSeconds(TestSessionContext.Current.Configuration.TimeoutSeconds), Browser = TestSessionContext.Current.Configuration.BrowserType, }; browser = new BrowserSession(configuration); return browser; }
public void BeforeScenario() { BrowserSession browserAtual; if (ScenarioContext.Current.TryGetValue<BrowserSession>(out browserAtual)) { Browser = browserAtual; return; } var config = new SessionConfiguration { Port = CassiniDevConfig.PortaServidor, AppHost = "localhost", Browser = Coypu.Drivers.Browser.HtmlUnitWithJavaScript, Timeout = TimeSpan.FromSeconds(5), RetryInterval = TimeSpan.FromSeconds(0.1)}; Browser = new BrowserSession(config); ScenarioContext.Current.Set<BrowserSession>(Browser); }
internal BrowserSession( SessionConfiguration sessionConfiguration, Driver driver, TimingStrategy timingStrategy, Waiter waiter, UrlBuilder urlBuilder, DisambiguationStrategy disambiguationStrategy, RestrictedResourceDownloader restrictedResourceDownloader ) : base(sessionConfiguration, null, driver, timingStrategy, waiter, urlBuilder, disambiguationStrategy) { this.restrictedResourceDownloader = restrictedResourceDownloader; }
internal BrowserSession( SessionConfiguration sessionConfiguration, DriverFactory driverFactory, TimingStrategy timingStrategy, Waiter waiter, UrlBuilder urlBuilder, DisambiguationStrategy disambiguationStrategy, RestrictedResourceDownloader restrictedResourceDownloader ) : base( sessionConfiguration, null, driverFactory.NewWebDriver(sessionConfiguration.Driver, sessionConfiguration.Browser), timingStrategy, waiter, urlBuilder, disambiguationStrategy ) { this.restrictedResourceDownloader = restrictedResourceDownloader; }
internal BrowserWindow(SessionConfiguration SessionConfiguration, ElementFinder elementFinder, Driver driver, RobustWrapper robustWrapper, Waiter waiter, UrlBuilder urlBuilder) : base(SessionConfiguration, elementFinder, driver, robustWrapper, waiter, urlBuilder) { }
internal BrowserWindow(SessionConfiguration SessionConfiguration, ElementFinder elementFinder, Driver driver, TimingStrategy timingStrategy, Waiter waiter, UrlBuilder urlBuilder, DisambiguationStrategy disambiguationStrategy) : base(SessionConfiguration, elementFinder, driver, timingStrategy, waiter, urlBuilder, disambiguationStrategy) { }
internal BrowserSession(DriverFactory driver, SessionConfiguration SessionConfiguration, RobustWrapper robustWrapper, Waiter waiter, RestrictedResourceDownloader restrictedResourceDownloader, UrlBuilder urlBuilder) : base(SessionConfiguration, null, driver.NewWebDriver(SessionConfiguration.Driver, SessionConfiguration.Browser), robustWrapper, waiter, urlBuilder) { this.restrictedResourceDownloader = restrictedResourceDownloader; }
internal RobustWindowScope(Driver driver, SessionConfiguration SessionConfiguration, RobustWrapper robustWrapper, Waiter waiter, UrlBuilder urlBuilder, Options options, WindowFinder windowFinder) : base(SessionConfiguration, windowFinder, driver, robustWrapper, waiter, urlBuilder) { this.options = options; }
internal BrowserSession(DriverFactory driver, SessionConfiguration SessionConfiguration, TimingStrategy timingStrategy, Waiter waiter, RestrictedResourceDownloader restrictedResourceDownloader, UrlBuilder urlBuilder, DisambiguationStrategy disambiguationStrategy) : base(SessionConfiguration, null, driver.NewWebDriver(SessionConfiguration.Driver, SessionConfiguration.Browser), timingStrategy, waiter, urlBuilder, disambiguationStrategy) { this.restrictedResourceDownloader = restrictedResourceDownloader; }
internal RobustWindowScope(Driver driver, SessionConfiguration SessionConfiguration, RobustWrapper robustWrapper, Waiter waiter, UrlBuilder urlBuilder, Options options, WindowFinder windowFinder) : base(SessionConfiguration,windowFinder,driver, robustWrapper, waiter, urlBuilder) { this.options = options; }
public Hooks(SessionConfiguration sessionConfig, ZukiniConfiguration zukiniConfig) { _sessionConfiguration = sessionConfig; _zukiniConfiguration = zukiniConfig; }