有沒有人能成功地從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 –