【问题标题】:The 'import org.openqa.selenium.android.AndroidDriver' cannot be resolved'import org.openqa.selenium.android.AndroidDriver' 无法解决
【发布时间】:2014-07-23 17:02:46
【问题描述】:

我正在尝试自动化一个 android 应用程序,

我采用了以下代码,

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.android.AndroidDriver;

public class LaunchElGiftoAndroid {
public static void main(String args[])throws Exception

{
    AndroidDriver ad=new AndroidDriver();
    System.out.println("Started");
    ad.get("http://www.gmail.com");
    System.out.println("Application Title"+ ad.getTitle());
    Thread.sleep(2000);
    ad.findElement(By.name("Email")).sendKeys("testing");
    ad.findElement(By.name("Passwd")).sendKeys("type password");
    ad.findElement(By.name("signIn")).click();
    System.out.println("Opened");
    ad.close();

}

}

我已经正确安装了 Web 驱动 apk。

我遇到了以下导入语句的问题。

导入 org.openqa.selenium.android.AndroidDriver;

【问题讨论】:

    标签: java android selenium


    【解决方案1】:

    我相信你使用的是旧的 AndroidDriver。

    在这种情况下,您应该使用 Selendroid。

    http://selendroid.io/mobileWeb.html

    【讨论】:

      【解决方案2】:

      如果您检查此webpage。 Selenium 建议您切换到 Selendroid,因为它具有更多功能和选项。您甚至可以在应用内实现自动化!

      【讨论】:

        猜你喜欢
        • 2014-09-19
        • 2013-08-20
        • 2016-11-12
        • 2020-09-01
        • 1970-01-01
        • 2017-05-26
        • 1970-01-01
        • 2014-09-15
        • 1970-01-01
        相关资源
        最近更新 更多