2

I have a Selenium script to automate the web site on any browser. Now, I want to execute this script on emulator or mobile device. I have tried to execute it by many ways but not get the success.

WebDriver driver = new AndroidDriver();

Throwing exception

Unable to start session Possible causes are invalid address of the remote server or browser start-up failure.

If any one any idea on this please help me. I also get to know that new selenium not require AndroidDriver. Please let me know.

1 Answer 1

4

Are you using Selendroid?

The same selenium script will work fine for android devices/emulators as well. But as we have a chromedriverserver for Chrome browser - you need to download the Selendroid jars, download the Android SDK, run the Selendroid server etc.

Follow the instructions here

EDIT :

        SelendroidLauncher selendroidServer = null;
        WebDriver driver = null;


        SelendroidConfiguration config = new SelendroidConfiguration();

        selendroidServer = new SelendroidLauncher(config);
        selendroidServer.lauchSelendroid();

        SelendroidCapabilities sc = new SelendroidCapabilities();
        sc.setBrowserName("android");
        sc.setPlatform(Platform.ANDROID);
        sc.setSerial("015d24a8394cAAAA");  //serial id of the device


        driver = new SelendroidDriver(sc);
        driver.get("http://m.ebay.de");   
Sign up to request clarification or add additional context in comments.

12 Comments

I am not using selendroid. In selenium web driver 2.31 version we have androiddriver() which use to execute the script on mobile but now in 2.40+ version androiddriver get omited and it stop working. There should be replacement for androiddriver.
@itin, I agree. Even then, it did not work out of the box. You had to download and setup android sdk & run the androidserver to connect to the real devices. But AndroidDriver got deprecated in later versions. Selendroid is the replacement for android now. seleniumhq.org/download
so Selendroid will be used for native app and web application in android both..? As per me it is for native app <14API...
for both. I am using selendroid for web based application in my project. It works great so far.
SEVERE: Error occurred while building server: io.selendroid.exceptions.SelendroidException: Command 'aapt' was not found inside the Android SDK. Please update to the latest development tools and try again. even i have given the path of aapt in enviroment varioable
|

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.