In the following paragraphs there wil be an example per browser for the configuration in Json and setup in C#.
This example expects you to have all the browsers installed and the drivers in your path variable
C# code to create a remote webdriver
// Defining webdriver variable
RemoteWebDriver _webDriver;
// Creating Capabilities and chosing browser
capabiliteiten = DesiredCapabilities.Edge();
// Setting platform
capabiliteiten.Platform = new Platform(PlatformType.Windows);
// Requesting remote webdriver
_webDriver = new RemoteWebDriver(_gridServerUri, capabiliteiten);
Node configuration in Json
{
"browserName":"MicrosoftEdge",
"platform": "WINDOWS",
"maxIstances": 1,
"seleniumProtocol": "WebDriver"
}
C# code to create a remote webdriver
// Defining webdriver variable
RemoteWebDriver _webDriver;
// Creating Capabilities and chosing browser
capabiliteiten = DesiredCapabilities.Chrome();
// Setting platform
capabiliteiten.Platform = new Platform(PlatformType.Windows);
// Requesting remote webdriver
_webDriver = new RemoteWebDriver(_gridServerUri, capabiliteiten);
Node configuration in Json
{
"browserName": "chrome",
"platform": "WINDOWS",
"maxInstances": 5,
"seleniumProtocol": "WebDriver"
}
C# code to create a remote webdriver
// Defining webdriver variable
RemoteWebDriver _webDriver;
// Creating Capabilities and chosing browser
capabiliteiten = DesiredCapabilities.Firefox();
// Setting platform
capabiliteiten.Platform = new Platform(PlatformType.Windows);
// Requesting remote webdriver
_webDriver = new RemoteWebDriver(_gridServerUri, capabiliteiten);
Node configuration in Json
{
"browserName": "firefox",
"platform": "WINDOWS",
"maxInstances": 5,
"seleniumProtocol": "WebDriver"
}
C# code to create a remote webdriver
// Defining webdriver variable
RemoteWebDriver _webDriver;
// Creating Capabilities
capabiliteiten = new DesiredCapabilities();
// Setting platform
capabiliteiten.Platform = new Platform(PlatformType.Windows);
// Chosing browser
capabiliteiten.SetCapability(CapabilityType.BrowserName, "operablink");
// Requesting remote webdriver
_webDriver = new RemoteWebDriver(_gridServerUri, capabiliteiten);
Node configuration in Json
{
"browserName": "operablink",
"platform": "WINDOWS",
"maxInstances": 5,
"seleniumProtocol": "WebDriver"
}
Platform type can be one of the following:
PlatformType.Android;
PlatformType.Any;
PlatformType.Linux;
PlatformType.Mac;
PlatformType.Unix;
PlatformType.Vista;
PlatformType.Windows;
PlatformType.WinNT;
PlatformType.XP;