【问题标题】:Unable to access Remote Webdriver to Browserstack using Codeception无法使用 Codeception 访问远程 Webdriver 到 Browserstack
【发布时间】:2015-12-11 08:20:10
【问题描述】:
  1. 我正在使用 PHP Codeception 为 Browserstack 编写脚本。

这是我的acceptance.yml文件

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'

但是通过命令行运行程序后,它会在命令提示符中显示如下错误消息。

**[Facebook\WebDriver\Exception\UnknownServerException]
   Session terminated**
  1. 我将从上述的acceptance.yml 文件中更改一些脚本,例如url: 'http://localhost:8080''browserstack.local': 'false'。 然后错误显示为“无法连接到服务器

谁能给点建议来解决这个问题。

【问题讨论】:

  • WebDriver: 应该比 config: 缩进更多:

标签: php codeception browserstack


【解决方案1】:

在 BrowserStack 上对 Android 模拟器(三星 Galaxy S5)执行测试时,需要如下设置能力:

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'

注意:browser 的 'android' 必须全部小写,platform 的全部大写。

Code Generator 对于在不同浏览器和操作系统组合(尤其是移动设备)上进行测试时指定功能非常有帮助。

如果您希望访问 BrowserStack 上的本地服务器,例如“http://localhost:8080”,您可以按照以下步骤操作:

a) 使用 binaries 设置本地测试连接。

b) 在脚本中添加'browserstack.local': 'true' 功能。

【讨论】:

    猜你喜欢
    • 2022-01-08
    • 1970-01-01
    • 2018-10-21
    • 2020-03-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多