Updating to Appium.WebDriver 5.0.0-beta01


I’ve been using Appium.Webdriver version 4.3.1 with selenium 3.141.0 to successfully conduct automated testing of my winforms app in both Windows 10 and 11 for 6 months now.

Here’s a snippet of code that I’ve used to sucessfully start and test with Notepad:

        var appiumOptions = new AppiumOptions();
        appiumOptions.AddAdditionalCapability("app", @"C:\Windows\System32\notepad.exe");
        appiumOptions.AddAdditionalCapability("deviceName", "WindowsPC");
        appiumOptions.AddAdditionalCapability("platformName", "Windows");
        // initialise the windows application driver session
        session = new WindowsDriver<WindowsElement>(new Uri(WindowsApplicationDriverUrl), appiumOptions);

I recently attempted to update to Selenium 4.3.0 and Appium.Webdriver 5.0.0-beta01. I’ve changed the above code to:
var appiumOptions = new AppiumOptions
//App = WinformsAppId,
App = “C:\Windows\System32\notepad.exe”,
DeviceName = “WindowsPC”,
PlatformName = “Windows”
// initialise the windows application driver session
session = new WindowsDriver(new Uri(WindowsApplicationDriverUrl), appiumOptions);

but I get this exception:
Bad capabilities. Specify either app or appTopLevelWindow to create a session

Is there another change that I need to make or is this a bug??

Thanks, GLV

1 Like