Skip to content

Appium Php Error: You must include a platformName capability #45

@jeyakumarsbe

Description

@jeyakumarsbe

Hi,

I'm new to appium. I write my first script and executed its throwing below error.
Below same Capabilities working Appium desktop Session.

My Code:

require_once "vendor/autoload.php";

class MySuperTests extends PHPUnit_Extensions_AppiumTestCase
{
public static $browsers = array(
array(
'host' => true,
'port' => 4444,
'browserName' => '',
'desiredCapabilities' => array(
'app' => 'D:\xamp\htdocs\appium\sample-code\examples\test\myapp.apk',
'platformName' => 'Android',
'platformVersion' => '7.0',
'deviceName' => 'emulator-5551'
)
)
);

// this fails for some reason
public function testInstallApp()
{
    $this->installApp('D:\xamp\htdocs\appium\sample-code\examples\test\myapp.apk');
}

}

$obj = new MySuperTests();
$obj->testInstallApp();

Got Below Error:

[info] [Appium] Welcome to Appium v1.7.2
[info] [Appium] Non-default server args:
[info] [Appium] address: localhost
[info] [Appium] port: 4444
[info] [Appium] Appium REST http interface listener started on localhost:4444[info] [HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"browserName":""}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"browserName":""},null,null]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1524208895020 (12:51:35 GMT+0530 (India Standard Time))
[error] [MJSONWP] Encountered internal error running command: Error: You must include a platformName capability
at AppiumDriver.getDriverForCaps (C:\Users\testuser\AppData\Local\appium-desktop\app-1.5.0\resources\app\node_modules\appium\lib\appium.js:66:13)

Please suggest me what i did wrong. I was executed php using command line
D:\xamp\htdocs\appium\sample-code\examples\test>php mytest.php

Thanks,
Jay

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions