我正在使用空手道框架来实现UI自动化。空手道框架支持无头浏览器测试吗?
发布于 2020-11-27 17:52:22
我们也可以使用chromedriver或geckodriver来实现chrome和firefox的无头工作。但请记住,这些需要与浏览器版本保持一致。不建议用于CI/CD。但如果我们需要在本地测试,则可以工作。下面是我在karate config.js中的配置(全局使用):
Chromedriver:
karate.configure('driver', {type: 'chromedriver', executable: '#(driverpath)' , webDriverSession: { desiredCapabilities: { browserName: 'chrome' , "goog:chromeOptions": { headless: true } } } } ); Firefox(geckodriver)
karate.configure('driver', {type: 'geckodriver', executable: '#(driverpath)', showDriverLog: true, webDriverSession: { "capabilities": { "alwaysMatch": { "moz:firefoxOptions": { args: ["-headless"] } } } } } );发布于 2020-09-14 11:59:05
如果您使用驱动类型chrome或Docker容器:https://github.com/intuit/karate/tree/master/karate-core#dockertarget,则支持
* configure driver = { type: 'chrome', headless: true }https://stackoverflow.com/questions/63877184
复制相似问题