gpt4 book ai didi

javascript - 使用 Javascript 中的 SauceLabs 在 iPhone 上进行 Selenium 测试

转载 作者:行者123 更新时间:2023-11-29 14:52:03 25 4
gpt4 key购买 nike

如何使用 Selenium 和 SauceLabs 对 iPhone 的 Javascript 应用程序进行端到端测试?我使用 wd.js 作为 Selenium 客户端库。

成为 browser require("wd").remote(..., "promiseChain") 的结果:

browser.init({ 
browserName: "iphone",
version: "4",
platform: "OS X 10.6",
deviceName: "iPhone",
"device-orientation": "portrait"
})
.sessionCapabilities()
.then(console.log.bind(console), console.log.bind(console))
.quit()

这导致:

{ [Error: [init({"browserName":"iphone","version":"4","platform":"OS X 10.6","deviceName":"iPhone","device-orientation":"portrait","record-video":false,"record-screenshots":false})] The environment you requested was unavailable.] data: 'Invalid device name specified: iPhone' }

但是组合直接取自https://saucelabs.com/platforms

对于所有其他组合,包括 Android 组合,一切正常。

最佳答案

需要删除 deviceName 属性,然后它才能工作。

关于javascript - 使用 Javascript 中的 SauceLabs 在 iPhone 上进行 Selenium 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24234357/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com