Appium Inspector 抛出错误,并且具有与我能够运行 TestNG 项目相同的成功所需功能
我编写了一个简单的 Java-TestNG 项目,其中所需的功能是
{
URL url = new URL("http://127.0.0.1:4724/wd/hub");
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(MobileCapabilityType.PLATFORM_NAME, "ANDROID");
caps.setCapability("appPackage", "com.xxx.xyz");
caps.setCapability("appActivity", "com.xxx.xyz.xyzActivity");
driver = new AppiumDriver(url,caps);
System.out.println("Application started");
}
但是当我在 Appium Inspector 中使用相同的功能时,
{
"platformName": "Android",
"appPackage": "com.xxx.xyz",
"appActivity": "com.xxx.xyz.xyzActivity"
}
我会弹出此文本
发现无效或不受支持的 WebDriver 功能(“appPackage”, “应用程序活动”)。确保仅使用有效的 W3C WebDriver 功能
I wrote a simple Java-TestNG project in which the desired capabilities are
{
URL url = new URL("http://127.0.0.1:4724/wd/hub");
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(MobileCapabilityType.PLATFORM_NAME, "ANDROID");
caps.setCapability("appPackage", "com.xxx.xyz");
caps.setCapability("appActivity", "com.xxx.xyz.xyzActivity");
driver = new AppiumDriver(url,caps);
System.out.println("Application started");
}
But when I used the same in Appium Inspector,
{
"platformName": "Android",
"appPackage": "com.xxx.xyz",
"appActivity": "com.xxx.xyz.xyzActivity"
}
I am getting pop up with this text
Invalid or unsupported WebDriver capabilities found ("appPackage", "appActivity"). Ensure to only use valid W3C WebDriver capabilities
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当我在 Appium Inspector 中输入与 Java-TestNG 程序相同的配置时,问题得到了解决,即
Appium Inspector 开始正常工作。有些 Appium Inspector 不喜欢这个配置,
The problem got resolved when I entered the same configuration as in the Java-TestNG program in to Appium Inspector, which is
The Appium Inspector started working fine. Some how Appium Inspector did not like this configuration,
问题可能是您可能在没有指定远程路径的情况下启动了 appium 检查器,因此它选择了默认路径“/”
将远程路径定义为“/wd/hub”。
这个解决方案对我有用。
The issue could be you might have started the appium inspector without specifying the remote path so it is picking up the default path which is "/"
Define the remote path as "/wd/hub".
This solution worked for me.