gpt4 book ai didi

java - Android 模拟器未启动。 browserName 总是抛出错误,但不包含在大写字母中

转载 作者:行者123 更新时间:2023-12-02 11:50:47 25 4
gpt4 key购买 nike

我正在尝试自动化 appium android,但所需的功能总是会为酱汁实验室抛出错误,例如:

Unable to parse remote response: Cannot specify both browserName and app caps.

我还没有在 cap 中添加 browserName,但它仍然在请求 JSON 中显示 key

我还使用curl命令将apk上传到服务器

完整错误:

Exception in thread "main" org.openqa.selenium.WebDriverException: Unable to parse remote response: Cannot specify both browserName and app caps. Please check our platforms configurator (https://wiki.saucelabs.com/display/DOCS/Platform+Configurator): {'deviceName': 'Android Emulator', 'app': 'sauce-storage:HelloGappium-android.zip', 'platform': 'ANDROID', 'browserName': 'chrome', 'version': '', 'deviceType': 'phone', 'deviceOrientation': 'portrait', 'platformVersion': '4.4', 'platformName': 'Android', 'appiumVersion': '1.5.1'} Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:01:39.354Z' System info: host: '', ip: '', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_131' Driver info: driver.version: AndroidDriver 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:142) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:89) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:600) at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142) at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:83) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:93) at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:72) at test.java.sauceLabs.HybridBaseSauceLabs.capabilities(HybridBaseSauceLabs.java:37) at test.java.sauceLabs.HybridBasetestcase.main(HybridBasetestcase.java:26)

我的代码:

public static AndroidDriver<AndroidElement> capabilities() throws MalformedURLException 
{

DesiredCapabilities caps = DesiredCapabilities.android();
caps.setCapability("appiumVersion", "1.5.1");
caps.setCapability("deviceName","Android Emulator");
caps.setCapability("deviceType","phone");
caps.setCapability("deviceOrientation", "portrait");
caps.setCapability("platformVersion", "4.4");
caps.setCapability("platformName","Android");
caps.setCapability("app","sauce-storage:HelloGappium-android.zip");

driver = new AndroidDriver<>(new URL(URL), caps);

return driver;
}

enter image description here

如果我遗漏了什么,请告诉我,因为我是酱汁实验室的新手

请分享您针对 Android 的酱汁实验室的工作上限

最佳答案

Here您可以找到平台配置器。 Sauce Labs 提供它来帮助您获得您所需要的合适的盖子。根据您的配置,网络测试的正确上限如下所示:

DesiredCapabilities caps = DesiredCapabilities.android();
caps.setCapability("appiumVersion", "1.6.4");
caps.setCapability("deviceName","Android Emulator");
caps.setCapability("deviceOrientation", "portrait");
caps.setCapability("browserName", "Browser");
caps.setCapability("platformVersion", "4.4");
caps.setCapability("platformName","Android");

对于混合应用测试,browserName将设置为:

caps.setCapability("browserName", "");

关于java - Android 模拟器未启动。 browserName 总是抛出错误,但不包含在大写字母中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47886890/

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