Appium Java Sauce Labs 云测试:Ran Desired

我是 Sauce 实验室的菜鸟。我第一次在 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



有只小跳蛙
浏览 165回答 2
2回答

慕哥6287543

代替“USERNAME”,您必须提及您的酱汁实验室用户名,代替“ACCESS_KEY”,您应该在以下行中提及您帐户的酱汁实验室访问密钥。WebDriver driver= new RemoteWebDriver(new URL("http://USERNAME:ACCESS_KEY@ondemand.saucelabs.com:80/wd/hub"),cap);如何获得访问密钥?1.登录酱料实验室,点击仪表盘。2.单击您的帐户菜单。单击我的帐户。3.您将找到访问密钥部分。4.单击显示按钮。它会要求授权。5.输入密码并复制Access key
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python