Search code examples
phpbddbehatappium

Configure Behat for using Appium


For a project, I try to configure Behat to work with Appium (for mobile testing).

But after configuring the behat.yml file to connect to Appium (the protocol used is the same as Selenium), I have an error that Behat cannot connect to the server.

Does somebody have ever configure Behat to work with Appium ? Can you help me ?


Solution

  • You need to change the URL when you create the webdriver in your script to 0.0.0.0:4723/wd/hub it's currently set to 127.0.0.1:4723/wd/hub/

    But once you fix that, you'll have another issue because your desiredCapabilities are also wrong. You're trying to add two browsers below? I don't understand what you're trying to do there.

    "browserName":"safari","version":"8","platform":"ANY","b‌​rowserVersion":"8","browser":"firefox","

    Please check the Appium documentation for how to fix them.