Created
August 29, 2018 17:36
-
-
Save jimevans/2bfbbeae8fec23ccb41a2ef9c8b328bc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Test] | |
| public void SimpleSelenium4Example() | |
| { | |
| //TODO please supply your Sauce Labs user name in an environment variable | |
| var sauceUserName = Environment.GetEnvironmentVariable("SAUCE_USERNAME", EnvironmentVariableTarget.User); | |
| //TODO please supply your own Sauce Labs access Key in an environment variable | |
| var sauceAccessKey = Environment.GetEnvironmentVariable("SAUCE_ACCESS_KEY", EnvironmentVariableTarget.User); | |
| var options = new EdgeOptions() | |
| { | |
| BrowserVersion = "latest", | |
| PlatformName = "Windows 10" | |
| }; | |
| var sauceOptions = new Dictionary<string, object>(); | |
| sauceOptions["username"] = sauceUserName; | |
| sauceOptions["accessKey"] = sauceAccessKey; | |
| sauceOptions["name"] = TestContext.CurrentContext.Test.Name; | |
| options.AddAdditionalCapability("sauce:options", sauceOptions); | |
| Driver = new RemoteWebDriver(new Uri("http://ondemand.saucelabs.com:80/wd/hub"), options.ToCapabilities(), | |
| TimeSpan.FromSeconds(600)); | |
| Driver.Navigate().GoToUrl("https://www.google.com"); | |
| Assert.Pass(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment