微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

密码:Webdriver ChromeOptions配置可使用Selenium

如何解决密码:Webdriver ChromeOptions配置可使用Selenium

`我将Codeception作为测试框架,并试图添加一个测试,该测试将使用Selenium和使用ChromeOptions的WebDriver模块一起单击Selenium。

我的测试正在进行中,以检查文件是否已下载,但是失败。

我正在accept.suite.yml中使用此配置:

# Codeception Test Suite Configuration
#
# Suite for acceptance tests.
# Perform tests in browser using the WebDriver or PHPbrowser.
# If you need both WebDriver and PHPbrowser tests - create a separate suite.

actor: AcceptanceTester
modules:
    enabled:
        - Asserts
        # Commented these out as they should not work with WebDriver enabled
#        - PHPbrowser:
#              # module configuration
#              url: blah.blah
        - Symfony:
              app_path: 'src'
              environment: 'test'
              em_service: 'doctrine.orm.entity_manager'
              rebootable_client: true
              part: SERVICES
        - Doctrine2:
              depends: Symfony
              cleanup: true
        # WebDriver is incompatible with the Symfony Module - Symfony module is needed for Foundry to be loaded
        - WebDriver:
            # URL the webdriver uses to access the running application
            url: 'http://127.0.0.1:80'
            browser: 'chrome'
            # Host & port of the webdriver instance
            host: 127.0.0.1
            port: 4444
            restart: true
            chromeOptions:
                - detach: false
                - window-size: 1920,1090
                - prefs:
                      - profile.default_content_settings.popups: 0
                      - download.default_directory: "/srv/cadence/tests/_output"
                      - browser.helperApps.neverAsk.savetodisk: "application/vnd.ms-excel"
        - \Helper\Acceptance

/srv/cadence/tests/_output是项目中写入其他测试输出文件夹的完整路径,但是,如果我在测试运行后将其装入容器中,则那里没有文件

我认为问题可能出在首选项上,但并不完全确定。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?