This project is working fine on my mac but now trying to run on windows but every times its shows error that platform name is blank. I am stuck here .
Can any one please get me out from this situation .
DesiredCapabilities capabilities = new DesiredCapabilities();
AndroidDriver driver = new AndroidDriver(capabilities);
// capabilities.setCapability("deviceName", "127.0.0.1:6555");
// capabilities.setCapability("deviceName","127.0.0.1:6555");
// capabilities.setCapability("platformVersion", "4.4.4");
// capabilities.setCapability("platformName","Android");
//
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME,"127.0.0.1:6555");
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME,"MobilePlatform.ANDROID");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION,"4.4.4");
//WeChat
AppiumDriverLocalService service = AppiumDriverLocalService.buildDefaultService();
service.start();
service = AppiumDriverLocalService.buildService(new AppiumServiceBuilder().usingPort(4723).usingDriverExecutable(new File("C:/Program Files/nodejs/node.exe")).withAppiumJS(new File("C:/Program Files (x86)/Appium/node_modules/appium/lib/server/main.js")));
service_url = service.getUrl().toString();
service.start();
//
Logss.
[Appium] Welcome to Appium v1.5.3
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> GET /wd/hub/status {}
[MJSONWP] Calling AppiumDriver.getStatus() with args: []
[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"versio
n":"1.5.3"...
[HTTP] <-- GET /wd/hub/status 200 14 ms - 83
[HTTP] --> GET /wd/hub/status {}
[MJSONWP] Calling AppiumDriver.getStatus() with args: []
[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"versio
n":"1.5.3"...
[HTTP] <-- GET /wd/hub/status 200 8 ms - 83
(node:2956) fs: re-evaluating native module sources is not supported. If you are
using the graceful-fs module, please update it to a more recent version.
←[31merror←[39m: Couldn't start Appium REST http interface listener. Requested p
ort is already in use. Please make sure there's no other instance of Appium runn
ing already.
[HTTP] --> GET /wd/hub/status {}
[MJSONWP] Calling AppiumDriver.getStatus() with args: []
[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"versio
n":"1.5.3"...
[HTTP] <-- GET /wd/hub/status 200 4 ms - 83
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"Android"
}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"platformName":"Andr
oid"}...
[Appium] Creating new AndroidDriver session
[Appium] Capabilities:
[Appium] platformName: 'Android'
[BaseDriver] SessionNotCreatedError: A new session could not be created. Details
: The desiredCapabilities object was not valid for the following reason(s): devi
ceName can't be blank.
at AndroidDriver.validateDesiredCaps (lib/basedriver/driver.js:120:25)
at AndroidDriver.validateDesiredCaps (lib/driver.js:31:20)
at AndroidDriver.callee$0$0$ (lib/basedriver/commands/session.js:14:8)
at tryCatch (C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\
node_modules\babel-runtime\regenerator\runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\Administrator\Ap
pData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\run
time.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\U
sers\Administrator\AppData\Roaming\npm\node_modules\appium\node_modules\babel-ru
ntime\regenerator\runtime.js:100:21)
at invoke (C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium\no
de_modules\babel-runtime\regenerator\runtime.js:136:37)
at enqueueResult (C:\Users\Administrator\AppData\Roaming\npm\node_modules\ap
pium\node_modules\babel-runtime\regenerator\runtime.js:185:17)
at Promise.F (C:\Users\Administrator\AppData\Roaming\npm\node_modules\appium