我正在嘗試為我的網頁撰寫空手道 UI 測驗,該測驗目前具有自簽名證書,因此默認情況下被瀏覽器阻止。根據檔案,當啟用acceptInsecureCerts引數時,應繞過此檢查。但是我找不到將這個引數傳遞給驅動程式的正確語法。這是我的(簡化的)功能檔案:
Feature: browser automation 1
Background:
* def session = { capabilities: { acceptInsecureCerts: true } }
* configure driver = { type: 'chrome', showDriverLog: true, showProcessLog: true, showBrowserLog: true, webDriverSession: '#(session)' }
Scenario: load demo page
Given driver 'https://127.0.0.1:8443/demo'
* waitUntil('document.readyState == "complete"')
* print 'page loaded'
* screenshot()
Then delay(2000).text('body')
當我運行這個時,我得到
13:31:25.237 [nioEventLoopGroup-2-1] DEBUG c.intuit.karate.driver.DriverOptions - << {"id":9,"result":{"result":{"type":"string","value":"Your connection is not private Attackers might be trying to steal your information from ...
uj5u.com熱心網友回復:
chrome等等,不是基于 webdriver,所以webDriverSession不會適用。它會為chromedriver.
我做了一個快速搜索,我能找到的最好的是:ignore-certificate-errors headless puppeteer google cloud
所以不確定這是否有效:
addOptions: ['--ignore-certificate-errors']
請報告您的發現以幫助他人!另一個參考是this,但不確定它是最新的:https : //peter.sh/experiments/chromium-command-line-switches
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/316767.html
下一篇:如何將CTest分組在一起?
