Road to run selenium test on custom Firefox profile

Following are the steps to create Firefox profile and launch selenium server.
1. Click start button >> Go to Run.
2. Type firefox.exe –P and click on OK button.

Road to data driven testing webdriver C# with Nunit

In this post I will show you how to implement data driven testing in webdriver C# using Nunit.
I put all data in xml file and fetch data during execution time of test. For data I have created data.xml file list country.

Road to screen recording in webdriver with C#

Last couple of days, I am searching screen recording by using webdriver with C# similar to “Monte Media Library” in java and finally I got the solution. Here, I am posting my finding so that it can help others.
For screen capturing Microsoft provide” Microsoft Expression Encoder 4” which can be download and install from link “http://www.microsoft.com/en-in/download/confirmation.aspx?id=27870

Default installation directory is “C:\Program Files\Microsoft Expression”.

Steps to create and run webdriver test.

1. You need to make sure that you have setup all required dll for of webdriver and Nunit.
2. Download and install”Microsoft Expression Encoder 4” from above mentioned url.
3. Add “Microsoft.Expression.Encoder.dll” from “C:\Program Files\Microsoft Expression\Encoder 4\SDK” folder to your webdriver project.

Road to automate android application using Robotium and Testdroid recorder.

In this post I will show you how to automate android application using robotium framework with testdroid recorder.
Testdroid recorder is capture user action , generate reusable android test case into robotium framework. For more detail about Testdroid visit link “click here

Prerequisites: 
  1. Eclipse should be installed in your machine.
  2. Android SDK should be installed.
  3. ADT Plug-in installed in to Eclipse. 
Testdroid installation: 

1. Start Eclipse and go to Help -> Install New Software
2. Click Add button; enter to field asking you a site to work with.
3. Fill in “Testdroid plug-in” for the Name
4. For the Location provide URL to Testdroid repository:  http://www.testdroid.com/updates/
5. Click ok button.

Road to setup and execute webdriver test scripts on android emulator

Prerequisites:

Following prerequisites you need to set up before starting.
1. Android SDK must be installed and setup path in your machine and virtual device should be created. For more detail how to setup and create virtual device visit my post “Road to create virtual android device( emulator ) in windows
2. Download selenium server and “android-server-2.32.0.apk” from link “Android server” and save in your machine.
3. Launched your avd device (emulator)

Installation of Webdriver APK into emulator: 

1. Put android “android-server-2.32.0.apk” file under “platform-tools” of installed android directory.
2. Run below command on console to check available devices.
adb  devices
Like below message displayed on your console.
D:\Android\android-sdk\platform-tools>adb devices
List of devices attached
emulator-5554   device

3. Go to “platform-tools” folder of installed android directory and run below command to install android server into mentioned emulator (device) id.
adb -s {{emulator-id}} -e install -r  android-server-2.32.0.apk

exp:
adb -s emulator-5554  -e install -r  android-server-2.32.0.apk 
Android driver installed into mentioned driver and you can see into your emulator

Road to execute JavaScript in Webdriver

Some time we need to execute JavaScript function of application using webdriver or need to inject a piece of java script code to perform some action in application.

Webdriver provide a “JavascriptExecutor “class for executing java script, Here is step and code for the same.
First you need to create “JavascriptExecutor” class object.

JavascriptExecutor js = (JavascriptExecutor) driver;

Now call “executeScript()” method by passing java script code as a argument.
js .executeScript(“java script code”)

Here are some more examples.
String readyState = (String)js.executeScript("return document.readyState");

String title = (String)js.executeScript("return document.title");

String domain = (String)js.executeScript("return document.domain");

WebElement el   = (WebElement)js.executeScript("return document.getElementById('rentc');");

js.executeScript("return document.getElementById('submit').click();");

Road to switch window in webdriver

In this post I am going to show you that how to switch windows in webdriver(selenium 2). Below are some circumstances where we need to some trick to switch window.

1. Suppose you have only two windows one is parent and other is child window (opened window), your new window and parent window has similar title.

In Java:
Set windows = driver.getWindowHandles();
Iterator iter = windows.iterator();                                    
String parented  = iter.next();
driver.switchTo().window(iter.next());

In C#
String parentId = driver.WindowHandles.FirstOrDefault();
String childId = driver.WindowHandles.LastOrDefault();
driver.SwitchTo().Window(childId );

In above example I store parent Id for further switch to parent window.

Road to email configuration in Jenkins CI tool

In this post I am going to see you that how to configure email in Jenkins or Hudson CI tools so that mail send after each build.
For Jenkins mail configuration first we need to install “Email-ext “ plugin.

In Jenkins Setup:

First you need to setup sender email Id to Jenkins. For this open Jenkins  on web browser, go to “Manage Jenkins”>> Configure System .
You will see “Extended E-mail Notification” and “E-mail Notification” configure these options as I configure in below screen.


Road to create and execute Calabash Android test for beginner

In my previous post I have written how to setup calabash android and how to find element locator details using calabash console. In this post I will show you how to create calabash android test. Also I will show you, how to generate report.

Steps to write scenario:
After running command >> calabash-android gen   calabash-android automatically generates cucumber skeleton folder-structure. Now you write cucumber test scenario for your application test scenario into created “my_first.feature” file as written below: