appium / dotnet-client

Extension to the official Selenium dotnet webdriver
Apache License 2.0
381 stars 187 forks source link

InvalidArgumentError: 'automationName' can't be blank #617

Closed moshemc1 closed 1 year ago

moshemc1 commented 1 year ago

Do I have the most recent component updates?

Is the component officially supported by the Appium team?

Is there an existing issue for this?

Current Behavior

Calling AppiumDriver.createSession() with args: [{"deviceName":"YAL-L41","platformName":"Android","browserName":"Chrome","automationName":"UiAutomator2","platformVersion":{"Major":10,"Minor":0,"Build":-1,"Revision":-1,"MajorRevision":-1,"MinorRevision":-1}},null,{"firstMatch":[{"platformName":"Android","browserName":"Chrome"}]}] [AppiumDriver@93cb] Plugins which can handle cmd 'createSession': images,relaxed-caps [AppiumDriver@93cb] Plugin relaxed-caps is now handling cmd 'createSession' [Appium] Could not parse W3C capabilities: 'automationName' can't be blank [AppiumDriver@93cb] Command 'createSession' was not handled by the following behaviours or plugins, even though they were registered to handle it: ["default","images"]. The command was handled by these: ["relaxed-caps"]. [debug] [AppiumDriver@93cb] Encountered internal error running command: InvalidArgumentError: 'automationName' can't be blank [debug] [AppiumDriver@93cb] at processCapabilities (C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\lib\basedriver\capabilities.js:345:13) [debug] [AppiumDriver@93cb] at parseCapsForInnerDriver (C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\lib\utils.js:139:40) [debug] [AppiumDriver@93cb] at AppiumDriver.createSession (C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\lib\appium.js:251:49) [debug] [AppiumDriver@93cb] at RelaxedCapsPlugin.createSession (C:\Users\Moshe.appium\node_modules\@appium\relaxed-caps-plugin\lib\plugin.js:58:25) [debug] [AppiumDriver@93cb] at C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\lib\appium.js:734:35 [debug] [AppiumDriver@93cb] at AppiumDriver.executeWrappedCommand (C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\lib\appium.js:774:22) [debug] [AppiumDriver@93cb] at AppiumDriver.executeCommand (C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\lib\appium.js:696:28) [debug] [AppiumDriver@93cb] at asyncHandler (C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\lib\protocol\protocol.js:393:32) [debug] [AppiumDriver@93cb] at C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\node_modules\@appium\base-driver\lib\protocol\protocol.js:518:15 [debug] [AppiumDriver@93cb] at Layer.handle [as handle_request] (C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\layer.js:95:5) [debug] [AppiumDriver@93cb] at next (C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\route.js:144:13) [debug] [AppiumDriver@93cb] at Route.dispatch (C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\route.js:114:3) [debug] [AppiumDriver@93cb] at Layer.handle [as handle_request] (C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\layer.js:95:5) [debug] [AppiumDriver@93cb] at C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:284:15 [debug] [AppiumDriver@93cb] at Function.process_params (C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:346:12) [debug] [AppiumDriver@93cb] at next (C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:280:10) [debug] [AppiumDriver@93cb] at logger (C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\node_modules\morgan\index.js:144:5) [debug] [AppiumDriver@93cb] at Layer.handle [as handle_request] (C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\layer.js:95:5) [debug] [AppiumDriver@93cb] at trim_prefix (C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:328:13) [debug] [AppiumDriver@93cb] at C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:286:9 [debug] [AppiumDriver@93cb] at Function.process_params (C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:346:12) [debug] [AppiumDriver@93cb] at next (C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\node_modules\express\lib\router\index.js:280:10) [debug] [AppiumDriver@93cb] at C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\node_modules\body-parser\lib\read.js:137:5 [debug] [AppiumDriver@93cb] at AsyncResource.runInAsyncScope (node:async_hooks:203:9) [debug] [AppiumDriver@93cb] at invokeCallback (C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\node_modules\raw-body\index.js:238:16) [debug] [AppiumDriver@93cb] at done (C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\node_modules\raw-body\index.js:227:7) [debug] [AppiumDriver@93cb] at IncomingMessage.onEnd (C:\Users\Moshe\AppData\Roaming\npm\node_modules\appium\node_modules\raw-body\index.js:287:7) [debug] [AppiumDriver@93cb] at IncomingMessage.emit (node:events:513:28) [debug] [AppiumDriver@93cb] at endReadableNT (node:internal/streams/readable:1359:12) [debug] [AppiumDriver@93cb] at processTicksAndRejections (node:internal/process/task_queues:82:21)

Expected Behavior

start session

Minimal Reproducible Example

var deviceName = DeviceInfo.Name; var version = DeviceInfo.Version; var platform = DeviceInfo.Platform;

            AppiumOptions appiumOptions = new AppiumOptions();
            appiumOptions.AddAdditionalCapability(MobileCapabilityType.DeviceName, deviceName);
            appiumOptions.AddAdditionalCapability(MobileCapabilityType.PlatformName, platform);
            appiumOptions.AddAdditionalCapability(MobileCapabilityType.BrowserName, "Chrome");
            appiumOptions.AddAdditionalCapability(MobileCapabilityType.AutomationName, "UiAutomator2");
            appiumOptions.AddAdditionalCapability(MobileCapabilityType.PlatformVersion, version);
            // Add any other desired capabilities

            // Set the Appium server URL
            Uri appiumServerUrl = new Uri("http://127.0.0.1:8888/wd/hub");
            AndroidDriver<AndroidElement> driver = new AndroidDriver<AndroidElement>(appiumServerUrl, appiumOptions);

Environment

Link to Appium Logs

No response

Futher Information

No response

Dor-bl commented 1 year ago

Hi @moshemc1, I can't see the appium dotnet client version you are using. Can you please add it? Thank you

moshemc1 commented 1 year ago

The appium client version is: 4.4.5 thank you

Dor-bl commented 1 year ago

Hi @moshemc1, Since you are using appium server 2.0.0-rc.3 You will either need to update the dotnet client version to the beta release or use an automationName with prefixed 'appium:'

Dor-bl commented 1 year ago

Closed as no response