Wednesday 30 October 2013

How to Install TestNG in Eclipse

  • Open Eclipse
  • Go to Help – Install New Software – Click Add
  • In Add Repository box, type TestNG and type the URL http://beust.com/eclipse
  • TestNG plugin will added into Available Software List.
  • Click on Next and follow the installation screen to complete the setup
  • Restart Eclipse and go to Run menu and open Run Configurations

Thursday 24 October 2013

Hybrid (Keyword + Data) Framework using Selenium WebDriver, JXL API, Log4J

Selenium Test Framework is a test automation framework, is developed using WebDriver, JXL API, LOG4J and MS Excel. It has following features -

  1. Hybrid (Keyword + Data) Framework
  2. Firefox browser testing
  3. Data Driven testing using XLS file, write one test method against multiple test data sets
  4. Well defined Tear Down feature, which provides ability to continue with test execution even in test failures/application crash
  5. HTML Test Report
  6. Test Script creation in XLS File
Visit link https://drive.google.com/file/d/0BypxAnZwsvAcYlVCajhMME5paWs/viewDrop a message if you want to download framework code.



Wednesday 2 October 2013

What is the difference between Browser and Page

Browser and Page are two different type of objects. A browser is a topmost level object for a website. and a page comes one level below it... One Browser object can have multiple pages inside it.

Monday 23 September 2013

Capturing the Sub Menu values using Selenium Web Driver

This program opens url and prints all submenu of Home menu.

import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;

public class ReadSubMenu {

public static void main(String[] args) {
WebDriver driver = new FirefoxDriver(); //object created to start firefox driver

Actions action = new Actions(driver); // object created to perfomr mouse operation

driver.get("http://demo.lateralcode.com/css-drop-down-menus/"); // open url

WebElement home = driver.findElement(By.linkText("Home")); // find home menu

action.moveToElement(home).build().perform(); //put mouse pointer on Home menu

List we = home.findElements(By.xpath("//*[@id='menu']/ul/li[1]/ul/li")); // common property of all sub menu item

//travers through all submenu & print their text
for (int i =0; i
{
System.out.println(we.get(i).getText()); //print submenu text
}
 }

}

Tuesday 17 September 2013

HP QTP :- What is the file extension of the script file and OR in QTP

In QuickTest Professional, File extension is as follows –

·        Per test object rep: filename.mtr
·        Shared Object rep: filename.tsr
·        Code file extension id: script.mts