有没有人能成功地从Android Studio运行appium测试?如果你能把我的工作样本传给我,我将不胜感激。成功从Android Studio运行appium代码?
我一直在试图让安装程序运行两个多星期。在试图运行测试的构建失败preDexDebug步骤与以下错误
trouble processing "javax/xml/XMLConstants.class"
Ill-advised or mistaken usage of a core class (java.* or javax.*) when not building a core library. This is often due to inadvertently including a core library file in your application's project, when using an IDE (such as Eclipse). If you are sure you're not intentionally defining a core class, then this is the most likely explanation of what's going on.
However, you might actually be trying to define a class in a core namespace, the source of which you may have taken, for example from a non-Android virtual machine project. This will most assuredly not work. At a minimum, it jeopardizes the compatibility of your app with future versions of the platform.
It is also often of questionable legality. If you really intend to build a core library -- which is only appropriate as part of creating a full virtual machine distribution, as opposed to compiling an application -- then use the \"--core-library\" option to suppress this error message.
.......... and the error goes on.
我试过使用--core-library选项。但是错误仍然存在。
我正在利用maven来收集appium的依赖关系。
compile 'io.appium:java-client:3.2.0'
我的首要问题:是appium及其附属兼容了Android Studio中运行?因为它在Eclipse上运行得非常流畅
评论io.appium dependency解决了上面提到的构建错误,但我必须评论我的测试。
在耗尽了我自己的知识之后,我在我的问题周围阅读了一些关于stackoverflow和其他互联网资源的文章,但没有具体的解决方案。这更像是一种“这可能奏效”的碰撞和尝试机制。我试过了,但没有成功。
因此,我想知道
- 首先,如果appium和它的依赖与Android Studio的工作非常好
- 工作方案的拉链(如果可能)
任何帮助非常感谢。
1.我希望你明白Android Studio只是一个IDE - 智能文本编辑器。您可以在记事本中编写代码,如果编写正确,它仍然可以工作。 Appium是一个独立的Selenium WebDriver包装框架,用于移动设备。 2.编号Web充满了例子 - 相信我。 3.看来你的应用程序没有正确的构建。 Appium对'“javax/xml/XMLConstants.class”'没有依赖性。 –
我一直在使用android studio为appium编写脚本,并没有任何问题。你正在使用哪个框架?我使用gradle,它工作正常。 – Gaurav
@Gaurav我正在使用gradle –