Codeception-无法连接到Webdriver(验收测试) [英] Codeception - Can't connect to Webdriver (Acceptance Test)

查看:103
本文介绍了Codeception-无法连接到Webdriver(验收测试)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以访问url并创建会话:

要执行Selenium Server,我使用了以下命令:

  java -Dwebdriver.gecko.driver =./geckodriver -jar"selenium-server-standalone-3.12.0.jar" 

我也尝试过IE和Chrome(我也遇到同样的问题):

  java -Dwebdriver.chrome.driver =./chromedriver -jar"selenium-server-standalone-3.12.0.jar"java -Dwebdriver.ie.driver =./IEDriverServer -jar"selenium-server-standalone-3.12.0.jar" 

acceptance.suite.yml

  class_name:AcceptanceTester模块:已启用:-WebDriver-\ Helper \ Acceptance配置:WebDriver:网址:"http://localhost"浏览器:firefoxwindow_size:820x1000 

  • 代码接收版本: 2.4.1
  • WebDriver Chrome版本: 2.38(win32)
  • WebDriver Firefox版本:0.20.1(x64)
  • Chrome版本::66.0.3359.139(64位)
  • Firefox版本::Firefox Quantum 60.0(64位)
  • Windows版本::Windows 8.1 64位
  • 硒版本: 3.12.0

解决方案

要启动 Selenium Server ,您无需传递/指定 WebDriver 变体即可开始 Selenium Server 如下:

  • 命令:

     > java -jar selenium-server-standalone-3.12.0.jar 

  • 控制台日志:

     <代码> C:\ Utility \ selenium-server-standalone> java -jar selenium-server-standalone-3.12.0.jar15:28:28.249信息[GridLauncherV3.launch]-硒构建信息:版本:'3.12.0',修订版:'7c6e0b3'15:28:28.251信息[GridLauncherV3 $ 1.launch]-在端口4444上启动独立的Selenium服务器2018-05-11 15:28:28.361:INFO :: main:将初始化@ 467ms记录到org.seleniumhq.jetty9.util.log.StdErrLog15:28:28.860信息[SeleniumServer.boot]-Selenium服务器已启动并在端口4444上运行 

  • 资源中心的快照:


更新

根据> codeception.com 中的文档> acceptance.suite.yml 应该如下所示:

 模块:已启用:-WebDriver:网址:"http://localhost/"浏览器:firefoxwindow_size:820x1000 

I can access url and create sessions:

http://localhost:4444/wd/hub/static/resource/hub.html

but when i execute ./codecept run i get an error, but i have Selenium Server running:

[ConnectionException] Can't connect to Webdriver at http://127.0.0.1:4444/wd/hub. Please make sure that Selenium Server or PhantomJS is running.

To execute Selenium Server, i used this command:

java -Dwebdriver.gecko.driver=./geckodriver -jar "selenium-server-standalone-3.12.0.jar"

I tried too with IE and Chrome (i have the same problem too):

java -Dwebdriver.chrome.driver=./chromedriver -jar "selenium-server-standalone-3.12.0.jar"
java -Dwebdriver.ie.driver=./IEDriverServer -jar "selenium-server-standalone-3.12.0.jar"

acceptance.suite.yml

class_name: AcceptanceTester
modules:
    enabled:
        - WebDriver
        - \Helper\Acceptance
    config:
        WebDriver:
            url: 'http://localhost'
            browser: firefox
            window_size: 820x1000

  • Codeception Version: 2.4.1
  • WebDriver Chrome Version: 2.38 (win32)
  • WebDriver Firefox Version: 0.20.1 (x64)
  • Chrome Version: 66.0.3359.139 (64-bit)
  • Firefox Version: Firefox Quantum 60.0 (64-bit)
  • Windows Version: Windows 8.1 64bit
  • Selenium Version: 3.12.0

解决方案

To start Selenium Server you need not require to pass/specify the WebDriver variant and you can start the Selenium Server as follows :

  • Command :

    >java -jar selenium-server-standalone-3.12.0.jar
    

  • Console Logs :

    C:\Utility\selenium-server-standalone>java -jar selenium-server-standalone-3.12.0.jar
    15:28:28.249 INFO [GridLauncherV3.launch] - Selenium build info: version: '3.12.0', revision: '7c6e0b3'
    15:28:28.251 INFO [GridLauncherV3$1.launch] - Launching a standalone Selenium Server on port 4444
    2018-05-11 15:28:28.361:INFO::main: Logging initialized @467ms to org.seleniumhq.jetty9.util.log.StdErrLog
    15:28:28.860 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 4444
    

  • Snapshot of the Resource Hub :


Update

As per the documentation at codeception.com the acceptance.suite.yml should have been as follows :

modules:
    enabled:
    - WebDriver:
       url: 'http://localhost/'
       browser: firefox
       window_size: 820x1000

这篇关于Codeception-无法连接到Webdriver(验收测试)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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