gpt4 book ai didi

java - Appium Java Sauce Labs 云测试 : Ran Desired Capabilities got Sauce Labs Authentication Error

转载 作者:太空宇宙 更新时间:2023-11-04 10:17:36 28 4
gpt4 key购买 nike

我是酱汁实验室的菜鸟。我第一次在 appium Desired 功能上运行我的 Sauce 实验室,并收到以下错误消息:

unable to parse remote response: Misconfigured -- Sauce Labs Authentication Error.
You used username 'USERNAME' and access key 'ACCESS_KEY' to authenticate, which are not valid Sauce Labs credentials.

我的问题是这样的:

  1. 这是什么?
  2. 如何修复它?
  3. 我犯了新手错误吗?
  4. 愚蠢的问题,但还是要问。我如何查看正在发生的事情
    酱汁实验室?

这是我所需的功能代码:

    public static final String USERNAME = "confidential";
public static final String ACCESS_KEY = "condfidential";
public static final String URL = "https://" + USERNAME + ":" + ACCESS_KEY + "@ondemand.saucelabs.com:443/wd/hub";

public static void main(String[] args) throws MalformedURLException{

DesiredCapabilities cap = new DesiredCapabilities();

cap.setCapability("platformName", "iOS");
cap.setCapability("deviceName", "iPhone8 Simulator");
cap.setCapability("platformVersion", "11.3");
cap.setCapability("browserName", "Safari");
cap.setCapability("deviceOrientation", "portrait");

WebDriver driver= new RemoteWebDriver(new URL("http://USERNAME:ACCESS_KEY@ondemand.saucelabs.com:80/wd/hub"),cap);

driver.get("https://www.bbc.co.uk/");

错误消息:

Unable to parse remote response: Misconfigured -- Sauce Labs Authentication Error.
You used username 'USERNAME' and access key 'ACCESS_KEY' to authenticate, which are not valid Sauce Labs credentials.

The following desired capabilities were received:
{'browserName': 'Safari',
'deviceName': 'iPhone8 Simulator',
'deviceOrientation': 'portrait',
'platformName': 'iOS',
'platformVersion': '11.3'}

Build info: version: '3.9.1', revision: '63f7b50', time: '2018-02-07T22:42:22.379Z'
System info: host: 'xxx-MacBook-Air.local', ip: '100.100.0.0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.6', java.version: '1.8.0_71'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:111)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:138)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:142)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:155)
at iOSCloudTesting.IosCloudSauce.main(IosCloudSauce.java:26

最佳答案

您必须提及您的酱汁实验室用户名来代替“USERNAME”,并且您应该提及您帐户的酱汁实验室访问 key 来代替“ACCESS_KEY”在下面的行中。

WebDriver driver= new RemoteWebDriver(new URL("http://USERNAME:ACCESS_KEY@ondemand.saucelabs.com:80/wd/hub"),cap);

如何获取访问 key ?

1.登录酱汁实验室,点击仪表板。

2.单击您的帐户菜单。单击“我的帐户”。

3.您将找到访问键部分。

4.单击显示按钮 。它将请求授权。

5.输入密码并复制访问 key

关于java - Appium Java Sauce Labs 云测试 : Ran Desired Capabilities got Sauce Labs Authentication Error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51502412/

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