Issue finding element using PHP and Behat

Hi,

i am trying to use behat with appium and want to click on a element.

i use the following method

/**
 * @When /^I press device button "([^"]*)"$/
 */
public function whenIPressById($id) {
    $this->getSession()->getPage()->findById($id);
    sleep(30);
    $this->getSession()->getPage()->findById('id',"$id");



}

Problem is that it does not use the ID but the xpath.

Appium shows me this :slight_smile:
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘//html/.//*[./@id = ‘positive_button’]’ using ‘XPATH’ with the contextId: ‘’ multiple: true

what i need is :
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘positive_button’ using ‘ID’ with the contextId: ‘’ multiple: false

so the existing method “findByID” seems to do something wrong.

The method looks like

public function findById($id)
{
$id = $this->getSelectorsHandler()->xpathLiteral($id);

    return $this->find('named', array('id', $id));
}

can anyone tell me why it is that way and what i can do to fix it ? its the method that comes with the framework.