All Projects → naveenchr → SeleniumTDD

naveenchr / SeleniumTDD

Licence: other
A Selenium TDD framework that incorporates key features of Selenium and TestNG which can be used to create web-based automation scripts.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to SeleniumTDD

MasterSeleniumFramework
Automation Testing | Web | Java | OOPS | Selenium WebDriver | TestNG | Maven | ExtentReport | Allure Reports | Java mail API | Design Patterns (Page Object Model, Singleton) | Jenkins | Data-Driven Testing using JSON file
Stars: ✭ 52 (+126.09%)
Mutual labels:  jenkins, maven, selenium, testng
MasterAppiumFramework
Automation Testing | Mobile | Java | OOPS | Appium | TestNG | Maven | ExtentReport | Java mail API | Logging (Log4J2) | Design Patterns (Page Object Model, Singleton) | Page Factories | Jenkins | Data-Driven Testing using JSON file | Expected Data using XML file
Stars: ✭ 27 (+17.39%)
Mutual labels:  jenkins, maven, testng, log4j2
Java.webdriver
Browser test automation using Selenium WebDriver in Java
Stars: ✭ 135 (+486.96%)
Mutual labels:  webdriver, maven, selenium, testng
Java.appium
Mobile test automation using Appium in Java
Stars: ✭ 59 (+156.52%)
Mutual labels:  webdriver, selenium, testng
Seleniumbase
A Python framework that inspires developers to become better test automation engineers. 🧠💡
Stars: ✭ 2,520 (+10856.52%)
Mutual labels:  jenkins, webdriver, selenium
Selenium Maven Template
A maven template for Selenium that will let you check out and go.
Stars: ✭ 403 (+1652.17%)
Mutual labels:  webdriver, maven, selenium
TestLeafSeleniumTraining
This is public repository for Selenium Learners at TestLeaf
Stars: ✭ 80 (+247.83%)
Mutual labels:  webdriver, selenium, testng
Selion
Enabling Test Automation in Java
Stars: ✭ 252 (+995.65%)
Mutual labels:  webdriver, selenium, testng
SeleniumDemo
Selenium automation test framework
Stars: ✭ 84 (+265.22%)
Mutual labels:  jenkins, maven, selenium
basic-selenium-project
an example selenium test project
Stars: ✭ 55 (+139.13%)
Mutual labels:  webdriver, maven, selenium
Jenkinsfiles
Examples for jenkins pipelines, comparing scripted and declarative syntax
Stars: ✭ 187 (+713.04%)
Mutual labels:  jenkins, sonarqube
event-recommender-festa
[SI -> 오늘회, 펫프렌드 이직, 연봉 35% 상승] 내 주변지역의 이벤트와 행사를 추천해주는 서비스
Stars: ✭ 64 (+178.26%)
Mutual labels:  jenkins, maven
Selenium Jupiter
JUnit 5 extension for Selenium WebDriver
Stars: ✭ 185 (+704.35%)
Mutual labels:  jenkins, selenium
drupalci-sonar-jenkins
DEPRECATED - Drupal CI environment with SonarQube and Jenkins for Drupal Core code analysis.
Stars: ✭ 40 (+73.91%)
Mutual labels:  jenkins, sonarqube
Orcid Source
ORCID Open Source Project
Stars: ✭ 233 (+913.04%)
Mutual labels:  jenkins, maven
generator-mitosis
A micro-service infrastructure generator based on Yeoman/Chatbot, Kubernetes/Docker Swarm, Traefik, Ansible, Jenkins, Spark, Hadoop, Kafka, etc.
Stars: ✭ 78 (+239.13%)
Mutual labels:  jenkins, sonarqube
google-meet-bot
Bot for scheduling and entering google meet sessions automatically
Stars: ✭ 33 (+43.48%)
Mutual labels:  webdriver, selenium
testng-metrics
A HTML Report of test executions via TestNG (No code changes required, Export results)
Stars: ✭ 3 (-86.96%)
Mutual labels:  selenium, testng
Sonar Scanner Jenkins
SonarQube Scanner for Jenkins
Stars: ✭ 155 (+573.91%)
Mutual labels:  jenkins, sonarqube
selenium BDD framework
Behavioural driven development UI automation framework using selenium, cucumber-java, testng, maven, phantomjs
Stars: ✭ 34 (+47.83%)
Mutual labels:  maven, testng

Selenium TDD Framework

A framework that incorporates key features of Selenium and TestNG which can be used to create web-based automation scripts.

Key Features

  • Supports method wise Parallel test execution
  • Screenshots can be taken for Pass/Fail steps
  • WebDriver manager based browser initiation
  • Platform independent
  • Integration with Extent Reports and Excel result updates
  • Automatic failure reruns
  • Integrated with sonarQube and java code coverage plugin for vulnerability analysis

Note : Utility class is a work in progress

Table of contents

Test Framework Design

image

Test Folder Structure

image

Installation

Clone the repo from GitHub using below command

git clone https://github.com/naveenchr/AutoFrameWork.git

Clean and compile the maven project using below commands

mvn clean
mvn compile

Running the tests

Start test execution from either command prompt or Jenkins

From Command Prompt

mvn clean test -DtestngXML=testng.xml -P Profile_1

Run with groups tag

mvn clean test -DtestngXML=testng.xml -Dgroups="Smoke Test" -P Profile_1

Manual failed run addition to automatic rerun

mvn test -P Profile_2

From Jenkins

mvn clean test -DparallelRun=$parallelMode -DthreadCount=$threadCount -DdataProviderThread=$dataProviderThread -DbrowserType=$browserType -DheadlessMode=$headlessMode -DtestngXML=$testngXML -Dgroups="Smoke Test" -P Profile_1

Report Location

test-output/ExtentReport.html

Sample Report

image

Creating new tests

Test Class File

package com.test.gui;

import java.util.HashMap;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.testng.annotations.Test;
import com.test.framework.BaseClass;
import com.test.pageobjects.GoogleHomePage;

public class PassFailTest {

	private static final Logger logger = LogManager.getLogger(PassFailTest.class);

	@Test
	public void googleTest_TC001(HashMap<String, String> dataHashMap) {

		try {
			GoogleHomePage googleHomePage = new GoogleHomePage(dataHashMap);
			googleHomePage.searchTextBox();
		} catch (Exception e) {
			BaseClass.getBaseObj().testFailureException(e);
		}
	}

Page Object File

package com.test.pageobjects;

import java.util.Map;
import org.openqa.selenium.By;
import com.test.framework.UtilityClass;

public class GoogleHomePage extends UtilityClass {

	private Map<String, String> map;

	public GoogleHomePage(Map<String, String> map) {
		this.map = map;
	}

	By searchTextBox = By.cssSelector("[type='text']");

	public void searchTextBox() {
		textField(searchTextBox, map.get("From Location"));
	}
}

Excel File

image

Generating sonar and jacoco reports

  • Add sonar server URL in POM file
<sonar.host.url>http://localhost:9000</sonar.host.url>
  • Execute the below maven command after the test run
mvn sonar:sonar

Built With

  • Selenium WebDriver
  • TestNG
  • Maven
  • Git
  • log4j
  • ExtentReport

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update the tests as appropriate.

License

MIT

Acknowledgments

References

  • Selenium WebDriver with Java -Basics to Advanced+Frameworks udemy
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].