1

I am trying to automate an android application,

I have taken following code,

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();

}

}

I have installed the Web driver apk properly.

i was getting problem with the following import statement.

import org.openqa.selenium.android.AndroidDriver;

2 Answers 2

1

I believe you using the old AndroidDriver.

You should be using Selendroid in that case.

http://selendroid.io/mobileWeb.html

Sign up to request clarification or add additional context in comments.

Comments

0

If you check this webpage. Selenium recommends you to switch to Selendroid as it has more features and options. You can even do automation inside an app!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.