Wednesday, October 16, 2013

Script-less Test Automation Framework/Tool

What is Script-less?

In Strict Sense--
A Framework that takes a collection of values; objects, methods and data ; runs them through a process that builds a script/code in memory, invokes and execute the underlying Test tool/libraries at run time. The actual script component never exists in the real world it only exists while the process is running.

however the framework does need to allow for scripted(coded) components to be called and run from same process that may not be easy to write in a keyword/code-less manner.Framework does not generate any code/script.

High Level Approach.

A set of libraries and modules that take keywords, objects, methods and data stored in Database and assembles a script in memory at run-time. The libraries and modules already have fine tuned code to handle exceptions and reporting.


Monday, October 14, 2013

Appium on windows - Android automation using ruby

Prerequisite -

  1. Android SDK with API level 17 and above is available.
  2. Ruby 1.9 and selenium - webdriver gem is installed.
  3. OS variable ANDROID_HOME is pointing to SDK folder


Here are Quick Steps to Setup and Run Sample App using ruby selenium webdriver.


  1. Download latest Appium for Windows from https://bitbucket.org/appium/appium.app/ , unzip it.
  2. Start Emulator or Connect your Device using USB.
  3. Download ContactManager.apk from https://github.com/appium/appium/tree/master/sample-code/apps/ContactManager
  4. adb install ContactManager.apk.
  5. Click on Appium.exe from unzipped folder and Start Appium Server by clicking on Launch Button with Default parameters.
  6. Run below ruby code from cmd / irb 

------------------------------------------------------------



require 'selenium-webdriver'

capabilities = {
'device' => 'Android',
  'browserName' => '',
  'platform' => 'WINDOWS',
  'version' => '4.2.2',
  #'app' => 'http://localhost/ContactManager.apk',
'app-package' => 'com.example.android.contactmanager',
'app-activity' => 'ContactManager'
}

server_url = "http://127.0.0.1:4723/wd/hub"

@driver = Selenium::WebDriver.for(:remote, :desired_capabilities => capabilities, :url => server_url)

btadd = @driver.find_element(:name, "Add Contact")
btadd.click()

textfields = @driver.find_elements(:tag_name,"textfield")
textfields[0].send_keys("Android_Appium")
textfields[2].send_keys("Android@Appium.com")
@driver.find_element(:name, "Save").click()

@driver.quit()


-----------------------------------------------




Web Test Automation Framework - Capybara vs Keyword-Driven

Web Test Automation Options - using pre-built DSL like capybara along with Cucumber to make it more collaborative exercise between Functional and Automation experts or creating a framework having collection of constructs(Keywords) to do basic operations on web app and later arranging them in a sequence to perform Test Flow.