2

我尝试使用wdio.conf.js.

capabilities: [{
    browserName: 'safari',
    'safari.options': {
        technologyPreview: true
    }
}]

每次我运行测试时,都会打开常规版本的浏览器。有人面临类似问题吗?

请在下面找到日志

[14:39:54]  COMMAND    POST      "/wd/hub/session"
[14:39:54]  DATA        {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"browserName":"safari","safari.options":{"technologyPreview":true},"loggingPrefs":{"browser":"ALL","driver":"ALL"},"requestOrigins":{"url":"http://webdriver.io","version":"4.6.2","name":"webdriverio"}}}
[14:39:55]  INFO    SET SESSION ID EE19F81D-B054-4926-8235-B64387250665
[14:39:55]  RESULT        {"applicationCacheEnabled":true,"rotatable":false,"databaseEnabled":true,"handlesAlerts":true,"version":"12604.3.5.1.1","cleanSession":true,"platform":"macOS","nativeEvents":true,"locationContextEnabled":false,"webStorageEnabled":true,"browserName":"safari","javascriptEnabled":true,"platformName":"macOS","cssSelectorsEnabled":true}
[14:39:56]  COMMAND    POST      "/wd/hub/session/EE19F81D-B054-4926-8235-B64387250665/url"
4

2 回答 2

2

似乎这是 Selenium 在其 Safari 驱动程序实现中“尚未”支持的功能。

经过一番研究后,我在几天前的笔记中发现了这个问题。

https://github.com/SeleniumHQ/selenium/issues/4537

靠近 Selenium 组织成员的底部:

从节点配置文件中读取“technologyPreview”设置尚未实现,这是一个独立的问题,我们正在开发此功能。

于 2017-11-15T21:22:50.243 回答
-2

不要使用 safari,但也许您可以像使用 chrome canary 一样打开二进制文件,并在二进制文件中定义 .exe。

    "browserName": "chromeCanary",
    "platform": "MAC",
    "chromeOptions": {
        "binary": "/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary"
    },
于 2017-11-11T16:47:59.273 回答