My Thoughts: Android
Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Thursday, April 26

FAILED CONFIGURATION: @BeforeTest setUpDriver java.lang.NoSuchMethodError: org.openqa.selenium.os.CommandLine.executeAsync()V



Today we have noticed the below errors while running our test scripts.


FAILED CONFIGURATION: @BeforeTest setUpDriver
java.lang.NoSuchMethodError: org.openqa.selenium.os.CommandLine.executeAsync()V
at org.openqa.selenium.firefox.FirefoxBinary.startFirefoxProcess(FirefoxBinary.java:92)
at org.openqa.selenium.firefox.FirefoxBinary.startProfile(FirefoxBinary.java:87)
at org.openqa.selenium.firefox.FirefoxBinary.clean(FirefoxBinary.java:225)
atorg.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:76)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:157)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:93)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:136)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:78)



So we have removed Android jars(android_webdriver_library-srcs.jar ,android_webdriver_library ) from our project Build path , then all the scripts started working fine.

We are still searching why this conflict happened and how to overcome this :)

Wednesday, April 25

Setup of Android WebDriver in Eclipse



Here are the Instruction for how to setup Android driver in Eclipse

1. Install  Android SDK 
Download the SDK zip file and unzip in your local computer.
Say download at “C:\android ” location
Go to unzipped folder and click on “Android SDK Manager” and install the following:
         a.Tools
         b.Extras
         c.Android API’s as per your choice (Say Android 2.2 , Android 4.0)

2. Install the ADT Plugin for Eclipse-
Goto Help > Install New Software....>> Add

3.Configure ADT Plugin
Window > Preferences...>>Android
Set the SDK location to where is your Android SDK has been installed.
Location will be something like:  C:\android\android-sdk-windows

4. Add the new AVD
In Eclipse goto Window >>AVD Manager>>
Create new AVD by clicking on “New” button.(Give the AVD  name  and select the Target)

5.Now download the Android APK 
Copy the file and paste it in the “Platform-tools” folder of the unzipped Android SDK.
Location will be something like “C:\android\android-sdk-windows\platform-tools

6. Now start the Android AVD (Which has been created in Step 4) by following below in your Eclipse
Window >>AVD Manager>> Select the created AVD and click on “Start”

7.  Find the installed emulator device id .
open the command prompt ( cmd ) and run the following command 
adb devices
Emulator device id will be something like “emulator-5554

8. Now from the command prompt, go to the “Platform-tools” folder of the unzipped Android SDK
cd "C:\android\android-sdk-windows\platform-tools"

9. Install the Android server by running the following command
adb -s <<emulator-id>> -e install -r  android-server-2.21.0.apk

10. Start the Android WebDriver application by running the following command
adb -s <<emulator-id>> shell am start -a android.intent.action.MAIN -n org.openqa.selenium.android.app/.MainActivity -e debug true

11. Now setup the port forwarding in order to forward traffic from the host machine to the emulator by running the following command
adb -s <<emulator-id>> forward tcp:8080 tcp:8080

If you have any problem then here is the official Reference :