我是 Sauce 實(shí)驗(yàn)室的菜鳥。我第一次在 appium Desired 功能上運(yùn)行我的 Sauce 實(shí)驗(yàn)室,我收到以下錯(cuò)誤消息: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.我的問題是這樣的:它是什么?我該如何解決?我犯了一個(gè)新手錯(cuò)誤嗎?愚蠢的問題,但要問。我如何查看醬汁實(shí)驗(yàn)室中發(fā)生的事情?這是我所需的功能代碼: 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/");錯(cuò)誤信息: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貢獻(xiàn)1831條經(jīng)驗(yàn) 獲得超10個(gè)贊
代替“USERNAME”,您必須提及您的醬汁實(shí)驗(yàn)室用戶名,代替“ACCESS_KEY”,您應(yīng)該在以下行中提及您帳戶的醬汁實(shí)驗(yàn)室訪問密鑰。
WebDriver driver= new RemoteWebDriver(new URL("http://USERNAME:ACCESS_KEY@ondemand.saucelabs.com:80/wd/hub"),cap);
如何獲得訪問密鑰?
1.登錄醬料實(shí)驗(yàn)室,點(diǎn)擊儀表盤。
2.單擊您的帳戶菜單。單擊我的帳戶。
3.您將找到訪問密鑰部分。
4.單擊顯示按鈕。它會(huì)要求授權(quán)。
5.輸入密碼并復(fù)制Access key
添加回答
舉報(bào)
0/150
提交
取消