WDIO:Multiremote Sauce-Labs 会话启动请求超时
WDIO: Request is timed out for Multiremote Sauce-Labs session start
我需要 运行 同时在 2 个不同的浏览器中进行测试 - 1 个 Web + 1 个移动 Web。
我正在尝试设置 wdio 以使用 Multiremote 设置,但没有成功。
我正在重试日志:
...
[0-0] 2021-12-30T13:36:26.056Z INFO webdriver: [POST] https://ondemand.eu-central-1.saucelabs.com:4723/wd/hub/session
[0-0] 2021-12-30T13:36:26.056Z INFO webdriver: DATA {
[0-0] capabilities: {
[0-0] alwaysMatch: {
...
然后失败并出现错误:
0-0] 2021-12-30T13:37:41.062Z ERROR webdriver: Request failed with status undefined due to RequestError: connect ETIMEDOUT my-ip:4723 when running "https://ondemand.eu-central-1.saucelabs.com:4723/wd/hub/session" with method "POST" and args "{"capabilities":{"alwaysMatch":{"browserName":"chrome","browserVersion":"latest","platformName":"macOS 11","sauce:options":{"extendedDebugging":true}},"firstMatch":[{}]},"desiredCapabilities":{"browserName":"chrome","browserVersion":"latest","platformName":"macOS 11","sauce:options":{"extendedDebugging":true}}}"
[0-0] 2021-12-30T13:37:41.062Z ERROR webdriver: RequestError: connect ETIMEDOUT my-ip:4723 when running "https://ondemand.eu-central-1.saucelabs.com:4723/wd/hub/session" with method "POST" and args "{"capabilities":{"alwaysMatch":{"browserName":"chrome","browserVersion":"latest","platformName":"macOS 11","sauce:options":{"extendedDebugging":true}},"firstMatch":[{}]},"desiredCapabilities":{"browserName":"chrome","browserVersion":"latest","platformName":"macOS 11","sauce:options":{"extendedDebugging":true}}}"
[0-0] at getTimeoutError (/Users/admin/Documents/Work/new-runner/node_modules/webdriver/build/utils.js:295:24)
...
我的测试仅包括我在描述和测试块中使用 browser.url('url')
命令打开 url。
整个项目是使用 yarn create wdio .
命令从零开始创建的。
我的配置文件是:
export const config: WebdriverIO.Config = {
port: 4723,
user: "my_user_name",
key: "my_key",
region: 'eu',
specs: [
'./tests/**/*.ts'
],
exclude: [
],
maxInstances: 6,
capabilities: {
webBrowser: {
capabilities: {
browserName: 'chrome',
browserVersion: 'latest',
platformName: 'macOS 12',
'sauce:options': {}
}
},
appBrowser: {
capabilities: {
browserName: 'Safari',
'appium:deviceName': 'iPhone 13',
platformName: 'iOS',
'appium:platformVersion': '15.0',
'sauce:options': {},
}
}
},
logLevel: 'info',
bail: 0,
baseUrl: 'http://localhost',
waitforTimeout: 10000,
connectionRetryTimeout: 120000,
connectionRetryCount: 3,
services: ['sauce', 'appium', 'selenium-standalone'],
framework: 'mocha',
reporters: ['spec'],
mochaOpts: {
ui: 'bdd',
timeout: 60000
},
}
我也无法像他们的指南中显示的那样在测试文件中访问我的浏览器,例如browser["webBrowser"].url('...')
.
请帮忙,谢谢非常!
显然,我问了这个问题后马上就找到了答案:/
答案是:删除端口选项,从服务中删除appium和selenium-standalone。
我需要 运行 同时在 2 个不同的浏览器中进行测试 - 1 个 Web + 1 个移动 Web。 我正在尝试设置 wdio 以使用 Multiremote 设置,但没有成功。 我正在重试日志:
...
[0-0] 2021-12-30T13:36:26.056Z INFO webdriver: [POST] https://ondemand.eu-central-1.saucelabs.com:4723/wd/hub/session
[0-0] 2021-12-30T13:36:26.056Z INFO webdriver: DATA {
[0-0] capabilities: {
[0-0] alwaysMatch: {
...
然后失败并出现错误:
0-0] 2021-12-30T13:37:41.062Z ERROR webdriver: Request failed with status undefined due to RequestError: connect ETIMEDOUT my-ip:4723 when running "https://ondemand.eu-central-1.saucelabs.com:4723/wd/hub/session" with method "POST" and args "{"capabilities":{"alwaysMatch":{"browserName":"chrome","browserVersion":"latest","platformName":"macOS 11","sauce:options":{"extendedDebugging":true}},"firstMatch":[{}]},"desiredCapabilities":{"browserName":"chrome","browserVersion":"latest","platformName":"macOS 11","sauce:options":{"extendedDebugging":true}}}"
[0-0] 2021-12-30T13:37:41.062Z ERROR webdriver: RequestError: connect ETIMEDOUT my-ip:4723 when running "https://ondemand.eu-central-1.saucelabs.com:4723/wd/hub/session" with method "POST" and args "{"capabilities":{"alwaysMatch":{"browserName":"chrome","browserVersion":"latest","platformName":"macOS 11","sauce:options":{"extendedDebugging":true}},"firstMatch":[{}]},"desiredCapabilities":{"browserName":"chrome","browserVersion":"latest","platformName":"macOS 11","sauce:options":{"extendedDebugging":true}}}"
[0-0] at getTimeoutError (/Users/admin/Documents/Work/new-runner/node_modules/webdriver/build/utils.js:295:24)
...
我的测试仅包括我在描述和测试块中使用 browser.url('url')
命令打开 url。
整个项目是使用 yarn create wdio .
命令从零开始创建的。
我的配置文件是:
export const config: WebdriverIO.Config = {
port: 4723,
user: "my_user_name",
key: "my_key",
region: 'eu',
specs: [
'./tests/**/*.ts'
],
exclude: [
],
maxInstances: 6,
capabilities: {
webBrowser: {
capabilities: {
browserName: 'chrome',
browserVersion: 'latest',
platformName: 'macOS 12',
'sauce:options': {}
}
},
appBrowser: {
capabilities: {
browserName: 'Safari',
'appium:deviceName': 'iPhone 13',
platformName: 'iOS',
'appium:platformVersion': '15.0',
'sauce:options': {},
}
}
},
logLevel: 'info',
bail: 0,
baseUrl: 'http://localhost',
waitforTimeout: 10000,
connectionRetryTimeout: 120000,
connectionRetryCount: 3,
services: ['sauce', 'appium', 'selenium-standalone'],
framework: 'mocha',
reporters: ['spec'],
mochaOpts: {
ui: 'bdd',
timeout: 60000
},
}
我也无法像他们的指南中显示的那样在测试文件中访问我的浏览器,例如browser["webBrowser"].url('...')
.
请帮忙,谢谢非常!
显然,我问了这个问题后马上就找到了答案:/
答案是:删除端口选项,从服务中删除appium和selenium-standalone。