RE: testNG use on Selenium WebDriver

Answered

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;
@Test

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

}
@Test

public static void accountTab() {
Test code here

}
@Test

public static void createAccount() {
Test code here

}

I call these from another package:

package SFModules;
import FrameWork.SFAccounts;
import org.testng.annotations.Test;
@org.testng.annotations.Test
public class Accounts {
@Test
public static void EndtoEnd() throws InterruptedException {
SFAccounts.Login("rallen","password");
SFAccounts.accountTab();
SFAccounts.createAccount();
}

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:

http://forumsqa.com/selenium-webdriver/how-to-choose-best-answer-insert-code-vote-up-an-answer/

Your Questions list:

http://forumsqa.com/member/lovetabike/

Regards,
Lakshay Sharma

on October 27, 2014.
Add Comment
1 Answers
Best answer

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

Please refer the link

http://seleniumworks.blogspot.in/2013/01/reportng-htmlxml-reporting-plug-in-for.html

Supporter Answered on October 23, 2014.
Add Comment

Your Answer

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