Skip to content

Instantly share code, notes, and snippets.

View nikolay-advolodkin's full-sized avatar

Nikolay nikolay-advolodkin

  • Sauce Labs
View GitHub Profile
@nikolay-advolodkin
nikolay-advolodkin / setSauceEnvVariables.ps1
Created September 23, 2018 21:29
Set sauce environment variables from .ps1 file
Param(
[string]$sauceUserName,
[string]$sauceAccessKey
)
Write-Host "sauce.userName that was passed in from Azure DevOps=>$sauceUserName"
Write-Host "sauce.accessKey that was passed in from Azure DevOps=>$sauceAccessKey"
[Environment]::SetEnvironmentVariable("SAUCE_USERNAME", "$sauceUserName", "User")
[Environment]::SetEnvironmentVariable("SAUCE_ACCESS_KEY", "$sauceAccessKey)", "User")
@nikolay-advolodkin
nikolay-advolodkin / ConfiguringChromeOptions.cs
Created August 24, 2018 20:56
How to set browerVersion and platformName for ChromeOptions
ChromeOptions options = new ChromeOptions();
options.UseSpecCompliantProtocol = true;
options.BrowserVersion = "latest";
options.PlatformName = "Windows 10";
Driver = new RemoteWebDriver(new Uri("http://ondemand.saucelabs.com:80/wd/hub"), options.ToCapabilities(),
TimeSpan.FromSeconds(600));