Below details the steps of using Selenium WebDriver with Android:
• Use Update Manager feature of your Eclipse installation to install the latest revision of ADT on your development computer. Launch Eclipse environment.
• Start Eclipse, then select Help > Install New Software
• The dialog that appears, click the Available Software tab.
• Click on Add Site button, In the Add Site dialog that appears, enter this URL in the "Location" field https://dl-ssl.google.com/android/eclipse/ and Name into Name Field
• Back in the Available Software view, you should now see "Developer Tools" added to the list. Select the checkbox next to Developer Tools, which will automatically select the nested tools Android DDMS and Android Development Tools. Click Next.
• In the resulting Install Details dialog, the Android DDMS and Android Development Tools features are listed. Click Next to read and accept the license agreement and install any dependencies, then click Finish.
• Installing windows will look like this
• Restart your Eclipse environment
• Download SDK from here http://developer.android.com/sdk/index.html
Configuring the ADT Plug-in
• Select Window > Preferences... to open the Preferences panel.
• Select Android from the left panel.
• For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory.
• Click Apply, and then OK.
Adding Android Platforms and Other Components
Before adding SDK components disable your antivirus services.
• Goto Windows>> Android SDK and AVD Manager
• Launch Android SDK and AVD Manager
• Click on Available Packages
• Select following options:
1. Documentation for Android SDK, API 8, revision 1
2. SDK Platform Android 2.2 API revision 2
3. Samples for SDK API 8, revision1
4. Google API by Google Inc., Android API 8, revesion 2
5. USB Driver Package revision 3
6. Market Licensing Package, revision 3
• And click on Install Selected button.
• Click on Install button.
Creating an AVD
An Android Virtual Device (AVD) is a device configuration for the emulator that allows you to model real world devices. In order to run an instance of the emulator, you must create an AVD.
• Select Window > Android SDK and AVD Manager.
• Click New to create a new AVD.
• Fill in the details for the AVD.
• Give it a name, a platform target, an SD card size, and a skin (HVGA is default).
• Click on Create AVD.
Running on the emulator
• To run your application, select Run > Run from the Eclipse menu bar.
Creating an Android Project
The ADT plug-in provides a New Project Wizard that you can use to quickly create a new Android project.
• Select File > New > Project
• Select Android > Android Project, and click Next.
• Select the contents for the project:
1. Enter a Project Name. This will be the name of the folder where your project is created.
2. Under Contents, select Create new project in workspace. Select your project workspace location.
3. Under Target, select an Android target to be used as the project's Build Target. The Build Target specifies which Android platform you'd like your application built against.
• Under Properties, fill in all necessary fields.
1. Enter an Application name. This is the human-readable title for your application — the name that will appear on the Android device.
2. Enter a Package name. This is the package namespace (following the same rules as for packages in the Java programming language) where all your source code will reside.
3. Select Create Activity (optional, of course, but common) and enter a name for your main Activity class.
4. Enter a Min SDK Version.
• Click on Finish button.
• Once you complete the New Project Wizard, ADT creates the folders and files in your new project.
Configure the WebDriver into Android:
1. Download “android-server-2.0.2rc3.apk ” from the following location http://code.google.com/p/selenium/downloads/list.
2. Copy the above downloaded file into folder “C:\Program Files\Android\android-sdk\platform-tools”
3. Run the “Command Prompt” as administrator.
4. Execute “cd C:\Program Files\Android\android-sdk\platform-tools”
5. Execute the command “adb install android-server-2.0.2rc3.apk”
Please feel free to post queries or share your views related to above.
Thanks,
Rohit Singh
www.360logica.com
Thursday, September 29, 2011
Subscribe to:
Post Comments (Atom)
interesting post, pretty much covered it all for me, thanks.
ReplyDeleteCan you provide test qutomation process using Selenium Android Driver?
ReplyDelete