Skip to content

A simplified Data-driven software automation testing framework along with Library architecture with multithreaded test execution implemented using Selenium and TestNG.

License

Notifications You must be signed in to change notification settings

georgescaria/gSTAX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gSTAX

A simplified Data-driven software automation testing framework along with Library architecture with multithreaded test execution implemented using Selenium and TestNG. For reference, use the sample project - gSTAX-Example

Setting up

  1. Add the following code to your pom.xml file.
<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependency>
    <groupId>com.github.georgescaria</groupId>
    <artifactId>gSTAX</artifactId>
    <version>main-SNAPSHOT</version>
</dependency>
  1. In your project, create a package named com.gSTAX.Tests and add your test classes. Extend the class InitialSetup where the driver and Test Case ID (TC_ID) is initialized.
package com.gSTAX.Tests;

import org.testng.annotations.Test;
import com.gSTAX.Setup.InitialSetup;

public class Website extends InitialSetup 
{
    @Test       
    public void WebsiteTest() throws Exception
    { //Perform actions }
}
  1. In the project root folder, create a folder named Test Data. Create a new excel file Testdata.xls/Testdata.xlsx. Format all the cells to 'Text' Structure the excel file in the below format.

    TC_ID Execute Class Name URL Browser
    TC_1 Y Amazon https://amazon.com Chrome
    TC_2 N Google https://google.com Edge

    The Test Cases that have a corresponding Execute column value 'Y' will only be run. For the above sample Testdata, only the class Amazon will run(create class Amazon.class in your project - com.gSTAX.Tests.Amazon). The website https://amazon.com will open up in Chrome browser. The following browsers are supported:

    1. Chrome
    2. Firefox
    3. Edge
    4. Opera
  2. Right click on the TestNG.xml file in your project and Run as RestNG Suite. And there you go!

    The test run report will be generated and saved in the folder Test Results in your project root folder.

Reporting

To use the Reporting functions, import the below to your Test class file.

import com.gSTAX.Utilities.Report;

The below reporting actions can be performed using the Report keyword.

  1. Informational

    1. Log event
    Report.logEvent("Log event"); 
    1. Take screenshot
    Report.takeScreenshot();
    1. Take screenshot with log message
    Report.takeScreenshot("Take screenshot with Log");
  2. Passing Test Case/ Test Step

    1. Pass with log message
    Report.pass("Pass test with log");
    1. Pass test with screenshot
    Report.passWithScreenshot();
    1. Pass test with screenshot and log message
    Report.passWithScreenshot("Pass test step with screenshot and log");
  3. Fail Test Case/ Test Step

    1. Fail with log message
    Report.fail("Fail test with log");
    1. Fail test with screenshot
    Report.failWithScreenshot();
    1. Fail test with screenshot and log message
    Report.failWithScreenshot("Fail test step with screenshot and log");

About

A simplified Data-driven software automation testing framework along with Library architecture with multithreaded test execution implemented using Selenium and TestNG.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages