无法通过Katalon中的SauceLabs打开浏览器并导航到远程Web服务器上的URL

时间:2019-05-19 12:10:39

标签: katalon-studio saucelabs

由于无法打开浏览器错误,我无法执行远程测试。

访问密钥和云平台配置很好。

PHP_BINARY

1 个答案:

答案 0 :(得分:1)

您是否提供有关浏览器,版本和操作系统的信息?该错误表明您不是。为了使用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);```