I am trying to convert a method to Java which adds DriverOptions and Desired Capabilities to ICapabilities. The method is currently written in C#.
Below are snippets of the C# code. What is causing me issues is the options.ToCapabilities(), which doesn't exist in Java.
Anyone have suggestions as to how to approach this conversion to Java?
We are using Java 8 and Selenium 3.0.1
Thanks in advance!
.....
ICapabilities browserCap;
DesiredCapabilities browserBaseCap;
if (options == null)
{
switch (browserType)
{
....proprietary code here...cannot include...
default:
throw new ArgumentException("The " + browserType.ToString() + " browser is not currently supported on the Grid network.
}
browserBaseCap.IsJavaScriptEnabled = true;
browserCap = browserBaseCap;
}
else
{
browserCap = options.ToCapabilities();
}
return browserCap;