java-client icon indicating copy to clipboard operation
java-client copied to clipboard

Documentation says deviceName is ignored for Android but server/client is requiring it

Open go2guy opened this issue 10 years ago • 8 comments

Description

Let me start by saying I'm not sure if this is a server side or client side issue. Appium starts up but the driver instance is requiring deviceName.

The documetation @ https://github.com/appium/appium/blob/1.5/docs/en/writing-running-appium/caps.md says that deviceName is currently ignored. "On Android this capability is currently ignored."

However if this is not supplied the following is seen in appium debug log. A new session could not be created. Details: The desiredCapabilities object was not valid for the following reason(s): deviceName can't be blank. (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 1.50 seconds

Environment

  • java client build version or git revision if you use some shapshot: 3.4.0
  • Appium server version or git revision you is use some shapshot: 1.5.0
  • Desktop OS/version used to run Appium if necessary: OSX El Capitan 10.11.3
  • Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe: v5.5.0
  • Mobile platform/version under test: API 21
  • Real device or emulator/simulator: Samsung S6

Details

Trying to get a driver instance using java-client and seeing this error.

Code To Reproduce Issue [ Good To Have ]

cap.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, context.getCurrentXmlTest().getParameter("appPackage")); cap.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, context.getCurrentXmlTest().getParameter("appActivity")); cap.setCapability(AndroidMobileCapabilityType.APP_WAIT_ACTIVITY, context.getCurrentXmlTest().getParameter("appWaitActivity")); cap.setCapability(MobileCapabilityType.UDID, context.getCurrentXmlTest().getParameter("udid")); cap.setCapability(MobileCapabilityType.PLATFORM_NAME, context.getCurrentXmlTest().getParameter("platformName")); cap.setCapability(MobileCapabilityType.PLATFORM_VERSION, context.getCurrentXmlTest().getParameter("platformVersion")); //cap.setCapability(MobileCapabilityType.DEVICE_NAME, context.getCurrentXmlTest().getParameter("realDevice")); //cap.setCapability(MobileCapabilityType.NO_RESET, false); cap.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 60); //cap.setCapability(MobileCapabilityType.FULL_RESET, false);

        AppiumDriverLocalService service = null;
        System.out.println("Starting Appium Service");
        try {
            service = new AppiumServiceBuilder().withCapabilities(cap)
                .withIPAddress("127.0.0.1")
                .withArgument(GeneralServerFlag.SESSION_OVERRIDE)
                .withArgument(GeneralServerFlag.LOG_LEVEL, context.getCurrentXmlTest().getParameter("logLevel"))
                .build();
            service.start();
            Assert.assertEquals(true, service.isRunning());
        } finally {
            if (service != null) {
                service.stop();
            }
        }

        driver = new AndroidDriver<MobileElement>(service, cap);
        ((AndroidDriver<MobileElement>) driver).launchApp();

Ecxeption stacktraces

Provided appium log below in gist. I can provide trace later if needed, but I rolled back to 1.4.16 currently to be productive.

Link to Appium logs

https://gist.github.com/nuggit32/3375d4edbca2a7ebb2af

go2guy avatar Mar 10 '16 14:03 go2guy

It is both ignored and required.

imurchie avatar Mar 10 '16 16:03 imurchie

Should the documentation be updated to reflect that statement then?

go2guy avatar Mar 10 '16 17:03 go2guy

Yes, it should. I'll make the change, unless you would like to?

imurchie avatar Mar 10 '16 17:03 imurchie

Please do, appears you're an appium member. I'm not...:)

go2guy avatar Mar 10 '16 17:03 go2guy

You can still make the change, you just can't merge it yourself. It requires forking appium, making the change, then opening a pull request.

imurchie avatar Mar 10 '16 17:03 imurchie

@nuggit32 Please add a reference to the PR.

I'm going to add WIKI. This information should be included.

TikhomirovSergey avatar Mar 10 '16 19:03 TikhomirovSergey

@imurchie thanks for issuing the PR. I was not available yesterday to do it, but was going to do it this AM.

go2guy avatar Mar 11 '16 14:03 go2guy

Was linked to https://github.com/appium/java-client/issues/321

TikhomirovSergey avatar Mar 11 '16 16:03 TikhomirovSergey