appium / dotnet-client

Extension to the official Selenium dotnet webdriver
Apache License 2.0
376 stars 186 forks source link

[Bug]: Creating WindowsDriver with AppiumOptions throws exeption #718

Closed Pegieo closed 6 months ago

Pegieo commented 6 months ago

Description

Could not create WindowsDriver to start session with Windows applicaction. The code below throws exception: "OpenQA.Selenium.WebDriverArgumentException : Bad capabilities. Specify either app or appTopLevelWindow to create a session"

Environment

Windows, Desktop Appium.WebDriver" Version="5.0.0-rc.2"

Details

It works with version 4.4.5

Code To Reproduce Issue


var appiumOptions = new AppiumOptions
                    {
                        App = "Notepad.exe",
                        DeviceName = "WindowsPC",
                        PlatformName = "Windows"
                    };

var driver = new WindowsDriver(new Uri(WindowsApplicationDriverUrl), appiumOptions);
Dor-bl commented 6 months ago

Try to add 'automationName' capability as well

Pegieo commented 6 months ago

Try to add 'automationName' capability as well

It still does not work.

mykola-mokhnach commented 6 months ago

If you are trying to use this client without Appium itself then it won't work as WAD does not support the W3C protocol.

Pegieo commented 6 months ago

But it worked with version 4.4.5 🤔

Dor-bl commented 6 months ago

Which appium version are you using?

Pegieo commented 6 months ago

WinAppDriver v1.2.1 but also tried v1.3

Dor-bl commented 6 months ago

I meant appium server driver. See this section on the Readme https://github.com/appium/dotnet-client#winappdriver-notice

Pegieo commented 6 months ago

Yes, using Appium instread of WinAppDriver directly resolved that problem. However, I got stuck with other issues for now e.g. https://github.com/microsoft/WinAppDriver/issues/1886 Thanks for help!

Dor-bl commented 6 months ago

@Pegieo, Can I close this issue?