How to bring latest platform version for andorid in APPIUM GUI?

Hi All,

I was doing my automation testing without any problem with API level 23 but a few days ago I updated my android phone to version 7.0 after that I would not able to do my testing with that Android version…

The problem which I am facing is that in my APPIUM GUI under Platform version API level 23(6.0) is coming… as my phone updated to 7.0 then how I can bring this new value to that appium GUI platform version drop down?

IN Android SDK manager also I installed all the packages related with API level 24 and 25.

Please help.

Thanks,
Sanjay

you may install command line Appium or try to start Appium GUI by setting manually API Level XX - just try to type.

@Aleksei,

Can you please explain more?

Thanks,
Sanjay

@Sanjay_Sharma

MAC:

brew install node             # get node.js
npm install -g appium@beta    # get latest appium
npm install wd                # get appium client
appium &                      # start appium

@Aleksei Thanks… As I am using windows can you please let me know how I can run these commands in windows.

@Sanjay_Sharma

Sanjay

Commands are same for windows System as well. But here are some prerequisites you need to follow to execute above commands. I will recommend using Node.js to install command line appium tool.

1. Download Node.js msi installer for your windows machine(32/64 bit).
2. Install Node.js in your windows machine.
3. Set up the node Path in your Env.path variables.
4. Type Node -v in your command line tool.
5. Type npm -v in cmd.

Follow this link for Node.js and npm installation.

If every thing goes fine you will see respective version number installed on your machine.

Now you are ready to install appium command line tool using npm (Node Package Manager).

Use Below Commands to install.

npm install -g appium

this will install latest version of appium which is 1.6.3 currently.

If you are interested in some specific version, you can try below command

npm install -g appium@versionNumber

e.g.

npm install -g [email protected]

To remove appium try below command

npm uninstall -g appium

-g stands for global

Hope this will help.

Regards
Ravi Kumar

@Sanjay_Sharma the answer of @ravikr42 is absolutely correct :slight_smile:

1 Like

@ravikr42 @Aleksei I installed latest appium from command line and i also installed latest Java client…

but still i am facing the below issue in APPIUM server logs

[debug] [MJSONWP] Bad parameters: BadParametersError: Parameters were incorrect. We wanted {“required”:[“desiredCapabilities”],“optional”:[“requiredCapabilities”,“capabilities”,“sessionId”,“id”]} and you sent [“capabilities”]
[HTTP] <-- POST /wd/hub/session 400 6 ms - 171

Eclipse IDE logs

Exception in thread “main” org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{app=C:\Users\sanjay\workspace\automation\bin\automation1\app-debug.apk, appPackage="my package, appActivity= launch activity, platformVersion=7.0, platformName=Android, deviceName=ce061606a9264a1005}], required capabilities = Capabilities [{}]
Build info: version: ‘3.3.1’, revision: ‘5234b32’, time: ‘2017-03-10 09:04:52 -0800’
System info: host: ‘DESKTOP-60QTADU’, ip: ‘192.168.68.1’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_111’
Driver info: driver.version: AndroidDriver

Please check

Regards,
Sanjay

@Sanjay_Sharma

It seems you are not supplying correct app package and app activity.
Can you share the block of code of your desired capabilities?

Thanks
Ravi Kumar

Thank you @Aleksei. :slight_smile:

@ravikr42

I think i am using the package and activity name correctly( i just removed the name)
File app= new File(“C:\Users\sanjay\workspace\automation\bin\automation1\app-debug.apk”);
DesiredCapabilities caps= new DesiredCapabilities();
caps.setCapability(“deviceName”,“ce061606a9264a1005”);
caps.setCapability(“platformName”,“Android”);
caps.setCapability(“platformVersion”,“7.0”);
caps.setCapability(“app”,app.getAbsolutePath());
caps.setCapability(“appPackage”,“com…”);
caps.setCapability(“appActivity”,“com…activity.HomeActivity”);
//caps.setCapability(“newCommandTimeout”, 0);

		 AndroidDriver<MobileElement> driver = new AndroidDriver<MobileElement>(new URL("http://0.0.0.0:4723/wd/hub"),caps);

@Sanjay_Sharma
Code looks fine.

I also installed latest selenium standalone server jar file but still getting the same…

@Sanjay_Sharma ok let see mine:
Capabilities [{app=/Users/jenkinss/Downloads/test_clients/xxxx.apk, noReset=false, clearSystemFiles=true, appWaitActivity=ee.xxxx.*, disableAndroidWatchers=true, version=, deviceName=LGH8155e9892e6, fullReset=true, platform=ANDROID, automationName=Appium, browserName=, autoGrantPermissions=true, udid=LGH8155e9892e6, platformName=Android}]

not important are: clearSystemFiles, disableAndroidWatchers, fullReset, noReset…

ok do try with:

capabilities = DesiredCapabilities.android();
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.APPIUM);
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "");
if (deviceName==null) { // connect to any device
   capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android");
} else { // connect to specific device
  capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, deviceName);
  capabilities.setCapability(MobileCapabilityType.UDID, deviceName);
}
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.ANDROID);
capabilities.setCapability(MobileCapabilityType.APP, app.getAbsolutePath());
capabilities.setCapability("appPackage", appPackage);
capabilities.setCapability("appActivity", appActivity);

@Aleksei @ravikr42 i got solution and it worked for me

I’ve deleted Appium Settings and Unlock apps from the phone and run tests again so that they reinstalled. That worked for me.

Thank you so much for giving me your time,

Welcome @Sanjay_Sharma :slight_smile:

Thank you !! , In addition to that then we need to open the CMD and enter the command ‘appium’ in order to start the server.
ex: c:\xyz\appium