Technical Project Lead @ Huawei Technologies

My photo
Bangalore/Hyderabad, Karnataka/Andhra Pradesh, India
Have an overall 13 + yrs of experience Currently working as an Senior Architect.Expertise in design,implementation of Automation frameworks for Opensource automation tools like Selenium,Jmeter, Webdriver,Appium, Robotium Expertise in integrating Test & ALM Management tools like Rally,Qmetry,JIRA-Zephyr with Automation frameworks Expertise in design and developmenet Mobile Automation frameworks for tools like Appium, Robotium Remote Control,Cucumber BDD,Manual Testing

Followers

Sunday, December 1, 2013

Prerequisites for running Tests On Real Devices

For Running tests on Real Devices (using .app file) You will need the following setup

  • Apple Developer profile
  • UDID of the Device(Iphone)
  • Application(.app) bundle ID
  • Your .app should be signed with valid provisioning profile
  • You have to build the rebuild .app file with your profile and should be able to deploy this .app from Xcode on your device.


For Running tests on Real Devices (using .ipa file) You will need the following Setup

  • Apple Developer profile
  • UDID of the Device(Iphone)
  • Application(.IPA) bundle ID
  • Your .Ipa file should be signed with valid developer provisioning profile
  • Since .Ipa file is an installation file you will need to have third party library called libimobile device. Appium internally uses the libimobile device.nstall .Ipa files on the real devices.
  • Download the source as zip (option provided on the bottom right of the page) from the following linkhttps://github.com/libimobiledevice/libimobiledevice
  • To be continued.....

Create Appium tests targetting IOS Simulator

Creating Tests for your simulator
1. Install the . app file on your Xcode simulator




















2.Get the .App path
3.You need to have selenium libraries to write the appium tests as appium used the Web driver interface
4.Open eclipse and write the following code. As same as your selenium web driver web tests
5.Start your appium from terminal using appium &

Note: Object id's that i have used in the below snapshot might be different for UICatelog application. please change them accordingly


Setting up Appium Server

Go to http://appium.io/ and download appium server. You have couple of option which appium to download
1. appium UI
2. appium nodeJs

I prefer nodeJs as I can launch it directly from code through command line terminal. However some times I use the UI version to inspect the elements. You can even launch the Inspector from terminal, hmm need to figure out and would be posting soon.

To work with appium on ease,I would recommend you to have your own MAC laptop with SDK 6. SDK 7 should also be fine but preferebly SDK 6 is recommended.

Setup.
1. Open up your mac terminal
2. Type the command sudo npm install -g appium

3.You should see appium getting downloaded and installedThat's it. What's next?1.You should have your Sample IOS app '.app'2. Get xCode 4.6 installed
3.Download the sample app source code from the URL
4. Open the code in xCode and build and run the app on Simulator. Good now you have your .app file built in project's product folder. Get the path of the app and note it some where (Check the below Image)


Next? Setting up your appium server to run your tests. Initially we will see how to setup appium server for Simulator tests.
1.Open the terminal and just run the command appium &
2.You should see the messages in the terminal that appium server is started on port 4723. This is the default port and can be customized later.
3.All set to run your tests.

IOS Native App Automation

Friends, It been long time since I have written my last blog. In this blog i'm putting my experiences using appium automation tool for IOS Native App Automation

Appium is one of the automation tool and seems to be promising in automation of IOS Native Apps. Initially, I started the evaluation with couple of open source tools appium and IOS Driver. Appium is the one, that is more active with stable & New releases.

Appium is the only tool that does not require any IOS instrumentation. It does it automatically

Some advantages listed out below
1.Supports Wedriver Interface API to write your tests in Java,Ruby....
2.Support all kinds of User Interactions like swipe (Single and multiple fingers),tap, longPress, Alerts,Picker wheel , switches and many more.
3.Runs tests on both Emulator and Real Devices.
4.Supports xPaths.
5.Comes with Object Inspector and Recoder. You need not run behind on how to inspect elements
6.Need not have reference to IOS app source code
7.Can run tests using .app or .Ipa files

Setting up Appium is little tricky as you don't get proper documentation.Initially you would end up in lots of appium server errors. However, it is very simple and just one step setup of Appium


Thursday, October 24, 2013

Android Automation using Robotium Remote Control

I have been Evaluation the following open Source automation tools and the ones I'm looking to have
is to support the following.
  1. Independent of Application(AUT) Source Code and the automation should be supported using APK
  2. Tool to support integration with  OOPS so that the framework can be built robust.
  3. Achieve execution of the tests from Client machine rather than running them on device.
  4. Independent of Instrumentation frameworks like Junit.
  5. Integrate the tool with other opensource API like log4j and other Java supported API
  6. Object identification support based on object properties like 'name' rather than screen coordinated.
  7. Build and continuous integration support

Initially started the analysis with Robotium and Monkey talk and below are my observations

Monkey talk : is an open source android Functional Automation tool that support both on record and scripting. Since the scripting t javascript based i was a bit biased in selecting this tool to integrated with our existing automation framework.

Parking Monkey Talk aside, I started evaluating thest Robotium. Below are my observations
  1. Cool Java API and seems to be best fit into my framework.
  2. Limitations of Robotium is that it is tightly coupled to Junit Instrumentation framework.
  3. Tests are compiled as apk files and execution happens over the device. hence it is difficult to control or Debug the tests.
  4. Cannot track the custom log message other than logcat messages.
I came across another version of Robotium called Robotium remote Control.
Observations:

  1. Execution can be controlled from a client machine which is the major advatage over Robotium Solo
  2. Independent of Junit Instrumentation Classes
  3. Support integration with log4j,Droid@Screen and other opensource Java API

Saturday, August 10, 2013

How to verify Google Search List Options using Selenium RC/ Webdriver

Below is the snippet for list the google search list options using both Selenium RC and web driver


package selenium;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverBackedSelenium;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import com.thoughtworks.selenium.Selenium;

public class GoogleTests {
    static WebDriver driver;
    public static void main(String[] args) throws InterruptedException {
        driver = new FirefoxDriver();
        driver.get("http://www.google.co.in");
        driver.findElement(By.xpath("//input[@type='text']")).sendKeys("Selenium webdriver");
         // Selenium Code to print all the options from the dropdown suggestionlist
        Selenium selenium = new WebDriverBackedSelenium(driver,
                "http://www.google.co.in");
        Thread.sleep(2000);
        System.out.println("Below list is printed by Selenium RC");
        int listCount = selenium.getXpathCount(
                "//table[@class='gssb_m']/tbody/tr").intValue();
        for (int i = 1; i < listCount; i++) {
            String listValues = selenium
                    .getText("//table[@class='gssb_m']/tbody/tr[" + i
                            + "]/td[1]/div/table/tbody/tr[1]/td[1]/span");
            System.out.println(listValues);
        }
        // Webdriver Code to print all the options from the dropdown suggestion list
        System.out.println("Below list is printed by Webdriver");
        List<WebElement> options = driver.findElements(By
                .xpath("//table[@class='gssb_m']/tbody/tr"));
        for (WebElement webElement : options) {
            System.out.println(webElement.getText());
        }
        // driver
        driver.close();
        driver.quit();

    }

}