Unable to access Remote Webdriver to Browserstack using Codeception

巧了我就是萌 提交于 2019-12-19 11:04:31

问题


  1. I am Writing scripts for Browserstack using PHP Codeception.

Here it is my acceptance.yml file

modules:
enabled:
  - WebDriver
config:
WebDriver:
  url: 'http://www.google.com'
  host: 'hub.browserstack.com'
  port: 80
  browser: Android
  device: Samsung Galaxy S5
  deviceOrientation: portrait
  capabilities:
    'browserstack.user': 'USERNAME'
    'browserstack.key' : 'ACCESS_KEY'
    'browserVersion': '21.0'
    'browserstack.debug': 'true'

But after run the program through the command line, it will be displaying as below error message in command prompt.

**[Facebook\WebDriver\Exception\UnknownServerException]
   Session terminated**
  1. I will change some script like url: 'http://localhost:8080' and 'browserstack.local': 'false' From the above acceptance.yml file. Then Error being displayed as "Unable to Connect to Server"

Can anyone please give some suggestion to resolve this problem.


回答1:


You need to set the capabilities as follows when executing a test on Android emulators (Samsung Galaxy S5) on BrowserStack:

config:

  WebDriver:

    url: 'http://www.google.com'

    host: 'hub.browserstack.com'

    port: 80

    browser: android

    capabilities:

      'browserstack.user': '<username>'

      'browserstack.key' : '<automate-key>'

      'device': 'Samsung Galaxy S5'

      'platform': 'ANDROID'

Note: 'android' for browser needs to be all lower case and for platform all upper case.

The Code Generator can be very helpful to specify the capabilities while testing on different browser and OS combinations especially mobile devices.

If you wish to access your local servers on BrowserStack, such as 'http://localhost:8080', you can follow these steps:

a) Setup a Local Testing connection using the binaries.

b) Add the capability 'browserstack.local': 'true' in your scripts.



来源:https://stackoverflow.com/questions/32559015/unable-to-access-remote-webdriver-to-browserstack-using-codeception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!