gpt4 book ai didi

java - 我在 Android 上启动 Appium 时遇到错误

转载 作者:行者123 更新时间:2023-12-02 09:26:58 27 4
gpt4 key购买 nike

在 Android 上启动 Appium 时出现以下错误:

Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: The desired capabilities must include either an app, appPackage or browserName Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'

我的代码:

package SignupUchat;

import java.net.MalformedURLException;
import java.net.URL;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;

import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.MobileCapabilityType;

public class Signup_Uchat {

public static void main(String[] args) throws Exception {
DesiredCapabilities dc=new DesiredCapabilities();

dc.setCapability(MobileCapabilityType.AUTOMATION_NAME, "Appium");
dc.setCapability(MobileCapabilityType.DEVICE_NAME, "HUAWEI");
dc.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
dc.setCapability(MobileCapabilityType.PLATFORM_VERSION, "8.1.0");
dc.setCapability("appPakage","com.android.calculator2");
dc.setCapability("appActivity","com.android.calculator2.Calculator");

URL url=new URL("http://127.0.0.1:4723/wd/hub");
AndroidDriver<WebElement> driver=new AndroidDriver<WebElement>(url,dc);
}
}

最佳答案

这看起来像是你的错误:

dc.setCapability("appPakage","com.android.calculator2");

应该:

dc.setCapability("appPackage","com.android.calculator2");

appPackage 不是 appPakage

Capabilities

关于java - 我在 Android 上启动 Appium 时遇到错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58279681/

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