Appium Dotnet 5.0.0-beta01: Cannot instantiate WIndowsDriver: AppiumOptions "Vendor Prefix" causing driver instantiation error
See original GitHub issueI was trying out the Appium 5.0.0 Beta01. My capabilities/options looked like this:
var options = new AppiumOptions();
options.AddAdditionalCapability("app", "root");
options.AddAdditionalCapability("ms:experimental-webdriver", true);
WindowsDriver driver = new WindowsDriver(new Uri(WinAppDriverUrl), options, TimeSpan.FromSeconds(60));
but this set of options, specifically the option for (“app”, "root), threw this error:
There is already an option for the appium:app capability. Please use the Application property instead. Parameter name: capabilityName
so I replaced it with this property instead:
options.App = "root";
which apparently passes the capability as (“appiumoption:app”,“root”) instead of the old (“app”, “root”) key-value pair.
and so now I get this errorr:
OpenQA.Selenium.WebDriverArgumentException: Bad capabilities. Specify either app or appTopLevelWindow to create a session
I looked into the Appium dotnet source code and looks like the AppiumOptions class’s method to create a new AppiumOption has been modified: AppiumOptions.cs diff: Appium 4.3.1 vs 5.0.0 Beta01 This method in particular seems to have brought the change, adding a vendor prefix before any and all additional options/capabilities:
public void AddAdditionalAppiumOption(string optionName, object optionValue)
{
string name = optionName.Contains(":") ? optionName : $"{VendorPrefix}:{optionName}";
this.ValidateCapabilityName(name);
this.additionalAppiumOptions[name] = optionValue;
}
I couldn’t find any way to get around it. Here’s a ticket for this issue in the Appium Dotnet Repo: https://github.com/appium/appium-dotnet-driver/issues/487
@kat-y @DHowett Is this being taken care of for the next release? This is a blocker on the upgrade path to Selenium 4 and Appium 5.
Issue Analytics
- State:
- Created 2 years ago
- Comments:22
Top GitHub Comments
Hi all, I am stuck as well. My test stopped working previous week on this error:
So I have started to solve it, I have tried perhaps all possibility combinations:
@pradeipp , did you get your issue resolved? I am using VS 2022 Pro and new to Appium/WinAppDriver. I am following a tutorial on launching notepad.exe using WinAppDriver. This line of code fails:
Can you please help?