为了账号安全,请及时绑定邮箱和手机立即绑定

Appium Java Sauce Labs 云测试:Ran Desired

Appium Java Sauce Labs 云测试:Ran Desired

有只小跳蛙 2021-06-07 17:31:51
我是 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.我的问题是这样的:它是什么?我该如何解决?我犯了一个新手错误吗?愚蠢的问题,但要问。我如何查看酱汁实验室中发生的事情?这是我所需的功能代码:  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
查看完整描述

2 回答

?
慕哥6287543

TA贡献1831条经验 获得超10个赞

代替“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


查看完整回答
反对 回复 2021-06-10
  • 2 回答
  • 0 关注
  • 164 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信