无法使用Codeception访问远程Webdriver到Browserstack [英] Unable to access Remote Webdriver to Browserstack using Codeception

查看:79
本文介绍了无法使用Codeception访问远程Webdriver到Browserstack的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  1. 我正在使用PHP Codeception为Browserstack编写脚本。

这是我的accept.yml文件

 模块:
启用:
-WebDriver
配置:
WebDriver:
网址:'http://www.google.com'
主机:'hub.browserstack.com'
端口:80
浏览器:Android
设备:Samsung Galaxy S5
设备方向:纵向
功能:
'browserstack.user':'USERNAME'
'browserstack.key':'ACCESS_KEY'
'browserVersion':'21 .0'
'browserstack.debug':'true'

但是在通过命令行运行程序之后,它将在命令提示符下显示为以下错误消息。

  ** [Facebook\WebDriver\Exception\UnknownServerException] 
会话终止**




  1. 我将更改某些脚本,例如 url:' http:// localhost:8080 ''browserstack.local' : false (来自上面的accepting.yml文件)。
    然后错误显示为 无法连接到服务器

有人可以给一些解决此问题的建议。

解决方案

在Android模拟器上执行测试时,您需要按如下所示设置功能(三星Galaxy S5)在BrowserStack上:

  config:

WebDriver:

url : http://www.google.com

主机: hub.browserstack.com

端口:80

浏览器: android

功能:

'browserstack.user':'<用户名>'

'browserstack.key':'<自动-键>'

'device':'Samsung Galaxy S5'

'platform':'ANDROID'

注意:用于浏览器的'android'必须全部小写,并且用于 platform 全部大写。



代码生成器对于在不同的浏览器和操作系统组合(尤其是移动设备)上进行测试时指定功能非常有用。



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



a)使用二进制文件建立本地测试连接。

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


  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.

解决方案

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.

这篇关于无法使用Codeception访问远程Webdriver到Browserstack的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆