public class Mobiletest {
private static AndroidDriver driver;
public static void main(String[] args) throws MalformedURLException,
InterruptedException {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
capabilities.setCapability("deviceName", "Redmi 1s");
capabilities.setCapability("platformVersion", "4.4.4");
capabilities.setCapability("platformName", "Android");
// capabilities.setCapability("app", app.getAbsolutePath());
capabilities.setCapability("appPackage",
"com.zipgo.customer");
capabilities.setCapability("appActivity",
"SplashActivity");
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),
capabilities);
// driver.manage().timeouts().implicitlyWait(80, TimeUnit.SECONDS);
}
它給出如下錯誤不往哪裏去錯org.apache.http.conn.HttpHostConnectException:連接到127.0.0.1:4723 [/127.0.0.1]失敗:連接被拒絕:連接
螺紋異常 「主要」 org.openqa.selenium.WebDriverException:org.apache.http.conn.HttpHostConnectException:連接到127.0.0.1:4723 [/127.0.0.1]失敗:連接被拒絕:連接 構建信息:版本:'unknown',修訂:'unknown',時間:'unknown' 系統信息:host:'INSPIRON',ip:'192.168.1.35',os.name:'Windows 8.1',os.arch:' amd64',os.version:'6.3',java.version:'1.8.0_40' 驅動程序信息:driver.version:AndroidDriver
注意appium正在運行測試 – wpj
任何其他之前手動啓動所需端口意味着任何4722,4724,我已經通過點擊播放符號手動啓動了appium服務器,並且一旦更改了端口編號爲4728它顯示在appium上的appium端口號4728上,但是當我運行Eclipse腳本時,它向我顯示了4723端口上的結果 – Jagaur
您是否已將端口更改爲android驅動程序和appium設置中的相同 – wpj