Select

A Manual Tester Becomes an Automation Engineer Using Fitnesse

We know Selenium IDE is one which is used by many manual testers and does not require knowledge of any programming language. But a manual tester can become an automation engineer using fitnesse. The developer need to create a framework using selenium rc/webdriver with any programming language like java, C# etc and integrate with fitnesse. There is no need to have knowledge of junit and testing framework.

I will show how this can be done step by steps

  1. Download fitnesse from http://fitnesse.org/FrontPage.FitNesseDevelopment.DownLoad

Unzip downloaded folder to any drive like C:\fitnesse

  1. Download selenium from http://seleniumhq.org/download/

Keep selenium-server-standalone-2.21.0.jar in C:\fitnesse

  1. Start fitnesse server clicking run.bat or from command prompt type java -jar fitnesse.jar
  2. Now open your browser and go to http://localhost. You will see the FitNesse home page.
  3. Click on Edit menu at left pane. Remove introduction note from home page and create project. We need to set path as shown below once our project is created.

!path selenium-server-standalone-2.21.0.jar

!path fitnesse.jar

!path lib/fitlibrary.jar

!path D:\Workplace\Fitenium\bin

Also configure SetUp and TearDown as if required.

 

  1. Make sure that you have created project Fitenium using eclipse in D drive in Workspace. Below I have created sample java class which utilizes java fixture wrappers around selenium call.

package com.sample.automation.framework;

import org.openqa.selenium.By;

import org.openqa.selenium.WebElement;

import com.sample.automation.browser.Browser;

import fitlibrary.SequenceFixture;

/*

* This class extends SequenceFixture so that we can create and use java style fixture in fitnesse*/

 

public class FitSeleniumFramework extends SequenceFixture

{

private static WebDriver driver;

public void initializeBrowser() {

driver = new FirefoxDriver();

}

public WebDriver getWebDriver() {

return driver;

}

public void stopBrowser() {

if(driver != null) {

driver.quit();

}

}

/*

* This is a fixture which we use to open home page url

*/

public void navigateToHomePage(String url) {

initializeBrowser();

try {

getWebDriver().navigate().to(url);

}catch (Exception e) {

System.out.println(“ERROR OPENING THE ” + url);

e.printStackTrace();

stopBrowser();

}

}

/*

* This fixture is used to check if particular element present on web page

*/

public boolean isElementPresent(String element) {

WebElement webElement = getWebDriver().findElement(By.xpath(element));

if(webElement != null)

return true;

else

return false;

}

  1. We have now two fixtures from above code

navigateToHomePage(String url)

isElementPresent(String element)

 

  1. Edit Project and create test suite namely HomePageSuite. Use Properties menu from left pane to change properties of page.

 

  1. Edit suite created in fitnesse and create test case namely “HomePageElements”. Write fixture in test case like

|navigateToHomePage|http://kayak.com|

|check|isElementPresent|//input[@id=”origin”]|true|

|check|isElementPresent|//input[@id=”destination”]|true|

|check|isElementPresent|//button[@id=”fdimgbutton”]|true|

 

  1. Run test case clicking Test button from left pane.

Once tester got familiar with fixture, effectively he can start productively automating test cases without any programming experience. There is no need for the whole team to   know java and selenium or any other programming language. By just understanding wiki markup and xpath or css, non-technical person can write test cases using fitnesse.

Interested in our Testing Services?

Contact Apexon +1 408-727-1100

By submitting this form, you agree that you have read and understand Apexon’s Terms and Conditions. You can opt-out of communications at any time. We respect your privacy.

By submitting this form, you agree that you have read and understand Apexon’s Terms and Conditions. You can opt-out of communications at any time. We respect your privacy.

Other stories you may enjoy...

Healthcare Apps and the Need for Security

One of the most exciting areas in tech right now promises to be “the most personal” ever. A key aspect of making wearable devices like the Apple Watch personal is through...

Developing an App for the 2020 General Election?

Here is a thought: With the UK General Election having just finished, could the next one in 2020 be the first to use a mobile app to allow people to vote? The polling...

Be honest. Describe the state of your test cases.

“There’s some dead wood in there.” “Hmmm…. Someone really needs to clean them up.” “A little outdated.” For those reading this in the northern hemisphere,...