LOGO Tech propulsion Labs Android Webdriver LOGO Test
LOGO Tech propulsion Labs Android Webdriver LOGO Test automation - Selenium 2 Masud Parvez SQA Architect Tech Propulsion Labs Email: masud@techprulsionlabs. com
All copyright is reserved by Tech propulsion labs Contents 1 What is Selenium ? 2 Selenium Versions 3 Life of Web story 4 Impact of JS
Contents 5 Mobile application testing 6 Android and Selenium 2 7 Web. Driver 8 Why Webdriver ?
Contents 9 Android Test architecture 10 Setup selenium for Android 11 How are we doing? 12 Limitations
Contents 13 Demo 14 Guide line for python 15 Way to walk in the future with us 16 Questions and Answers
What is selenium ? v Selenium is a suite of tools to automate web app(!!!!) testing across many platforms. Selenium runs in many browsers and operating systems. v Free wear
Selenium versions 2011 2008 2004 y Jul ium len Se 2 1 -1 2 b -- ium ---- ium y uar Jan len Se ------- len Se
Updates in Selenium 2 1 Mobile application testing. 2 Fire fox 4, 5, 6, 7 3 Experimental IE 9 and chrome support 4 Web. Driver
Why do we need Selenium? ? ? ? Selenium ?
Life before the Web Total Application Market
Yesterday HTML +JS Total Application Market
Data Total Application Market
Today HTML JS Total Application Market
Tomorrow HTML JS Total Application Market
Today Selenium Lives here HTML JS Total Application Market
Tomorrow Selenium Lives here HTML JS Total Application Market
Mobile application testing 1 2 3 i. Phone/ i. Pad Android WP 7
Android and selenium 2 Android driver
Webdriver New tech that Selenium 2 Test direct access browser No proxy server New API
Why Webdriver ? v Web. Element. find. Element is universal - all UIs are trees Ø Web has DOM (elements) Ø Windows has HWND Ø Android has Views
Why Webdriver ? v Many operations are universal between all UIs Matching: Øclear Øclick Øfind. Element(By. id)
Why Webdriver ? v Extensible API Ø Web. Driver API extensions, such as Rotatable, Ø Rendered. Web. Element, are implemented by a subset of drivers. v Creating a new API for every platform is cumbersome instead: Ø Emphasize the similarities with the core Web. Driver API Ø Supply simple platform-specific extensions as needed. v Facilitate piece-wise code re-usage
Android-Driver Interaction architecture
Setup selenium for Android Phase 1 Set up SDK Phase 2 Set up Emulator Phase 3 Start Emulator
Setup selenium for Android Phase 4 Install the App Phase 5 Port Forwarding Phase 6 Run your test
Download Android SDK v Web link: www. http: //developer. android. com/sdk/index. html
Installation Command v Update SDK. /android update sdk v Create Emulator. /android create avd --target 2 --name newavd v Run emulator. /emulator. exe -avd newavd
Installation Command v Install android driver in emulator. /adb install name_and v Forward port. /adb forward tcp: 8080 v If You are using eclipse then install ADT kit
Script v v // Calling android driver Android. Driver driver = new Android. Driver(); v // And now use this to visit Google v driver. get("http: //google. com"); v v // Find the text input element by its name Web. Element element = driver. find. Element(By. name("q")); v v // Enter something to search for element. send. Keys("Tech Propulsion Labs");
Script v // Now submit the form. Web. Driver will find the form for us from the element v element. submit(); v v // Check the title of the page System. out. println("Page title is: " + driver. get. Title()); v //Turn off the driver v driver. quit();
Limitations v Slower than Headless Web. Kit Driver v Support for SDK versions 2. 2 and prior, has been deprecated v Does not work on emulators running 2. 3 because of an emulator bug that should be fixed soon by Android. However it works on Devices running 2. 3 and higher
DEMO
QUESTION
By python v To install the Python client library: # pip install -U selenium v Import the Selenium 2 namespace from selenium import webdriver v i. Phone driver = webdriver. Remote(browser_name="iphone", command_executor='http: //172. 24. 101. 36: 3001/hub') v Android driver = webdriver. Remote(browser_name="android", command_executor='http: //127. 0. 0. 1: 8080/hub') v Google Chrome driver = webdriver. Chrome() v Firefox driver = webdriver. Firefox()
Way to walk in the future with us v Blog: www. masudparvez. weebly. com/blog v Post in blog regarding this topic http: //masudparvez. weebly. com/1/post/2011/08/an driod-webdriver-want-to-test. html
Way to walk in the future with us v Android. apk Automation Test link: http: //www. youtube. com/watch? v=yi 6 Z 3 l 0 ci 1 o&fe ature=mfu_in_order&list=UL v Selenium automation framework Link: http: //www. youtube. com/watch? v=wpud. Db 3 ECPA &feature=mfu_in_order&list=UL
Masud Parvez SQA Architect Email: masud@techpropulsionlabs. com Copyright 2011 Tech Propulsion Labs, Inc.
- Slides: 37