Error: Failed to start an Appium session, err was: Error: The following desired capabilities are required, but were not provided: platformName, deviceName

H,
I have upgraded Appium from 1.1.0.0 to 1.3.4.1. I use Appium installer in windows (for Cucumber+Page Object)
When I run the script, I am getting this error
error: Failed to start an Appium session, err was: Error: The following desired capabilities are required, but were not provided: platformName, deviceName
but I have given all the details in Android settings in the appium tool. The same setup was working fine with Appium 1.1.0.0.

Kindly help me out in fixing this issue.

Thanks,
Chan

Can you please share your whole code which you did?

You need to implicitly define the capabilities in your code as well not only on the GUI tool. This is how it looks for java :

	 capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
	 capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "4.4.2");
	 capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Android");
1 Like

Ok.
I understood.
the working script is :
caps = { :browserName => browser_name, :platformName => “Android”, :newCommandTimeout => 60000, :deviceName => “4D00C0124B174161” }
client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 5000
browser = Selenium::WebDriver.for(:remote, :url => “http://localhost:4723/wd/hub/”, :http_client => client, :desired_capabilities => caps)

earlier it was
caps = { :browserName => browser_name, :platform => “Android”, :newCommandTimeout => 60000, :device => “4D00C0124B174161” }
client = Selenium::WebDriver::Remote::Http::Default.new
client.timeout = 5000
browser = Selenium::WebDriver.for(:remote, :url => “http://localhost:4723/wd/hub/”, :http_client => client, :desired_capabilities => caps)
but it worked with Appium1.1.0.0 (I set the capabilities in Appium UI itself)
I think in later versions we need to provide capabilities with the exact keys present in the http://appium.io/slate/en/master/?ruby#appium-server-capabilities.
Thanks for your interest and reply.