testNG use on Selenium WebDriver


I’m trying to modularize my tests a bit. I have 1 Class with multiple test methods.  This needs to be broken down further but I’m starting slowly.so it’s like:

package FrameWork;
import java.util.Arrays;

import java.util.concurrent.TimeUnit;
import org.testng.Assert;

import org.testng.annotations.AfterTest;

import org.testng.annotations.BeforeTest;

import org.testng.annotations.Test;

import org.openqa.selenium.Alert;

import org.openqa.selenium.By;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.WebElement;

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.chrome.ChromeOptions;

import org.openqa.selenium.remote.DesiredCapabilities;

import org.openqa.selenium.support.ui.ExpectedConditions;

import org.openqa.selenium.support.ui.Select;

import org.openqa.selenium.support.ui.WebDriverWait;

public class SFAccounts {

public static WebDriver driver;

public static void Login(String strUsername, String strPassword) {
Test code here


public static void accountTab() {
Test code here


public static void createAccount() {
Test code here


I call these from another package:

package SFModules;
import FrameWork.SFAccounts;
import org.testng.annotations.Test;
public class Accounts {
public static void EndtoEnd() throws InterruptedException {

Everything runs fine. My classes are called and run. What I don’t’ get now is granular test results as I did when I just ran the SFAccounts class  .  My results just state that my “EndtoEnd” test passed.

Hi Richard,

I request you to close all the questions you asked so far, see how to choose best answer of your question:


Your Questions list:


Lakshay Sharma

on October 27, 2014.
Add Comment
  • 1 Answer(s)
    Best answer

    You Can Use ReportNG to track sub level reporting , It is a addon to TestNG

    Please refer the link


    Supporter Answered on October 23, 2014.
    Add Comment
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.