无法通过 Katalon 中的 SauceLabs 打开浏览器并导航到远程 Web 服务器上的 URL
Unable to open browser and navigate to URL on remote Web Server through SauceLabs in Katalon
由于无法打开浏览器错误,我无法执行远程测试。
access key和云平台配置没问题
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword.openBrowser(OpenBrowserKeyword.groovy:81)
at com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword.execute(OpenBrowserKeyword.groovy:67)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.openBrowser(WebUiBuiltInKeywords.groovy:60)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$openBrowser.call(Unknown Source)
at ListClassScenario.run(ListClassScenario:13)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase[=11=].call(Unknown Source)
at TempTestCase1558267636783.run(TempTestCase1558267636783.groovy:21)
```Caused by: org.openqa.selenium.WebDriverException: Unable to parse remote response: No browserName or device specified in session request. Please check our platforms documentation (https://saucelabs.com/docs/platforms): {'username': 'T007', 'platform': 'macOS 10.14', 'version': '74', 'proxy': {'proxyType': 'direct'}, 'browserName ': 'Chrome', 'accesskey': 'XXXXXXXX-XXXX-XXXX-XXXX-XXXX894f5fa4'}
您是否提供有关浏览器、版本和 OS 的信息?该错误表明您不是。为了使用 Saucelabs,您需要将 DesiredCapabilities 设置为所需浏览器的 RemoteWebDriver:
baseUrl = config.get("baseUrl").toString();
String platform = config.get("platform").toString();
String browser = config.get("browser").toString();
String browserVersion = config.get("browserVersion").toString();
String recordVideo = config.get("recordVideo").toString();
String recordScreenshots = config.get("recordScreenshots").toString();
String build = config.get("build").toString();
String tags = config.get("tags").toString();
logger.info(testName + ": Creating new RemoteWebDriver with the following settings: "
+ platform + ", " + browser + ", " + browserVersion);
DesiredCapabilities caps = getDesiredCapabilitiesForBrowser(browser);
caps.setCapability("platform", platform);
caps.setCapability("browserVersion", browserVersion);
caps.setCapability("timeZone", "Denver");
caps.setCapability("name", testName);
caps.setCapability("recordVideo", recordVideo);
caps.setCapability("recordScreenshots", recordScreenshots);
caps.setCapability("build", build);
caps.setCapability("tags", tags);
caps.setCapability("commandTimeout", 600);
caps.setCapability("idleTimeout", 1000);
RemoteWebDriver driver = new RemoteWebDriver(getRemoteSauceLabsAddress(), caps);```
由于无法打开浏览器错误,我无法执行远程测试。
access key和云平台配置没问题
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
at com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword.openBrowser(OpenBrowserKeyword.groovy:81)
at com.kms.katalon.core.webui.keyword.builtin.OpenBrowserKeyword.execute(OpenBrowserKeyword.groovy:67)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.openBrowser(WebUiBuiltInKeywords.groovy:60)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$openBrowser.call(Unknown Source)
at ListClassScenario.run(ListClassScenario:13)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase[=11=].call(Unknown Source)
at TempTestCase1558267636783.run(TempTestCase1558267636783.groovy:21)
```Caused by: org.openqa.selenium.WebDriverException: Unable to parse remote response: No browserName or device specified in session request. Please check our platforms documentation (https://saucelabs.com/docs/platforms): {'username': 'T007', 'platform': 'macOS 10.14', 'version': '74', 'proxy': {'proxyType': 'direct'}, 'browserName ': 'Chrome', 'accesskey': 'XXXXXXXX-XXXX-XXXX-XXXX-XXXX894f5fa4'}
您是否提供有关浏览器、版本和 OS 的信息?该错误表明您不是。为了使用 Saucelabs,您需要将 DesiredCapabilities 设置为所需浏览器的 RemoteWebDriver:
baseUrl = config.get("baseUrl").toString();
String platform = config.get("platform").toString();
String browser = config.get("browser").toString();
String browserVersion = config.get("browserVersion").toString();
String recordVideo = config.get("recordVideo").toString();
String recordScreenshots = config.get("recordScreenshots").toString();
String build = config.get("build").toString();
String tags = config.get("tags").toString();
logger.info(testName + ": Creating new RemoteWebDriver with the following settings: "
+ platform + ", " + browser + ", " + browserVersion);
DesiredCapabilities caps = getDesiredCapabilitiesForBrowser(browser);
caps.setCapability("platform", platform);
caps.setCapability("browserVersion", browserVersion);
caps.setCapability("timeZone", "Denver");
caps.setCapability("name", testName);
caps.setCapability("recordVideo", recordVideo);
caps.setCapability("recordScreenshots", recordScreenshots);
caps.setCapability("build", build);
caps.setCapability("tags", tags);
caps.setCapability("commandTimeout", 600);
caps.setCapability("idleTimeout", 1000);
RemoteWebDriver driver = new RemoteWebDriver(getRemoteSauceLabsAddress(), caps);```