1. 程式人生 > >Appium執行報錯java.lang.NoSuchMethodError: org.openqa.selenium.remote.HttpCommandExecutor.

Appium執行報錯java.lang.NoSuchMethodError: org.openqa.selenium.remote.HttpCommandExecutor.

第一次使用appium,執行Java指令碼總是報錯:java.lang.NoSuchMethodError:org.openqa.selenium.remote.HttpCommandExecutor.……

導致driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),cap);這裡空指標。我的執行環境:eclipse

解決方法:滑鼠右鍵xxx.java  --> RunAs -->Run Configurations -->選擇左邊欄中JUnit下對應的xxx類名(如果已預設選中則跳過這一步)--> 點選對話方塊下方 Select Other --> 勾選 Use configuration specific settions  --> 選擇 Android JUnit Test Launcher  --> 點選ok。   再次 RunAs -> JUnit Test