Posts

extent-config.xml

 <?xml version="1.0" encoding="UTF-8"?> <extentreports>     <configuration>         <!-- report theme -->         <!-- standard, dark -->         <theme>standard</theme>         <!-- document encoding -->         <!-- defaults to UTF-8 -->         <encoding>UTF-8</encoding>         <!-- protocol for script and stylesheets -->         <!-- defaults to https -->         <protocol>https</protocol>         <!-- title of the document -->         <documentTitle>Extent</documentTitle>         <!-- report name - displayed at top-nav -->         <reportName>Automation Report</reportName>     ...

extent.properties

 extent.reporter.spark.start=true extent.reporter.spark.out=test-output/SparkReport/SparkReport.html extent.reporter.spark.config=src/test/resources/extent-config.xml screenshot.dir=test-output/ screenshot.rel.path=../ #pdf report configuration extent.reporter.pdf.start=true extent.reporter.pdf.out=test-output/PDFReport/PdfReport.pdf extent.reporter.spark.vieworder=dashboard,test,category,exception,author,device,log systeminfo.os=Windows systeminfo.user=QA AUTOMATION CLASSES systeminfo.build=0.1.1

db.json

 {   "posts": [     {       "id": 1,       "title": "Change Post1 by put",       "author": "By Author 1"     },     {       "id": 2,       "title": "Post2",       "author": "Test Author2"     },     {       "id": 3,       "title": "War Coverage",       "author": "Chun Li"     },     {       "id": 4,       "title": "QA AUTOMATION CLASSES",       "author": "SMRUTI"     },     {       "id": 5,       "title": "JSON Server",       "author": "ABC"     },     {       "id": 6,       "title": "New Moon",       "author": "Seith"     },     {       "id": 7,       "t...

bdd selenium pom.xml

  <? xml version ="1.0" encoding ="UTF-8" ?> < project xmlns ="http://maven.apache.org/POM/4.0.0" xmlns: xsi ="http://www.w3.org/2001/XMLSchema-instance" xsi :schemaLocation ="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" > < modelVersion >4.0.0</ modelVersion > < groupId >com.qaautomationclasses</ groupId > < artifactId >BDDCucumberFrameworkPractice</ artifactId > < version >1.0-SNAPSHOT</ version > < properties > < maven.compiler.source >21</ maven.compiler.source > < maven.compiler.target >21</ maven.compiler.target > < project.build.sourceEncoding >UTF-8</ project.build.sourceEncoding > </ properties > < dependencies > <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-core --> < depen...
Image
  Introduction to Gherkin: ·          Gherkin document is also known as feature file and will have name followed by. feature extension ·          Each Line in a Gherkin document start with one of the Gherkin keywords. ·          Single line comments are only allowed comments starting with # before it. ·          Block comment is not supported by Gherkin. ·          Indentation is supported by tab or two spaces. Keywords (Alphabetic): 1.        Feature 2.        Rule 3.        Example / scenario 4.        Examples / scenarios 5.        Given 6.        When 7.     ...

BaseSteps.java : Extent report configuration & Screenshot code implementation

  package com.automationexercise.automationUtilities; import com.aventstack.extentreports.ExtentReports; import com.aventstack.extentreports.ExtentTest; import com.aventstack.extentreports.reporter.ExtentSparkReporter; import com.aventstack.extentreports.reporter.configuration.Theme; import io.github.bonigarcia.wdm.WebDriverManager; import org.apache.commons.io.FileUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.openqa.selenium.OutputType; import org.openqa.selenium.TakesScreenshot; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.edge.EdgeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.testng.annotations. AfterClass ; import org.testng.annotations. AfterMethod ; import org.testng.annotations. BeforeClass ; import org.testng.annotations. BeforeMethod ; import java.io.File; import java.io.IOException; import java.time.Duration; import java.util.P...

log4j2.xml

Image
LOG4J2: Log 4j is used to capture the run time logs of the application or our automation framework execution details, We can configure the information we need and that can be shown on console so that it becomes easy to understand the flow or we can start keeping the log information in to a file and can see the details there as well Since log4j 1.x has vulnerabilities and is no longer supported. We can see it in Maven Central Repository. We need to go with log4j2 .Add log4j core and log4j api into pom.xml as dependencies. Log4j2 configuration can be done in two ways i.e. using log4j2.xml and log4j2.properties In this framework I will be using log4j2.xml Log levels in log4j: Trace < Debug < Info < Warn < Error < Fatal< Off 1.        OFF 2.        FATAL 3.        ERROR 4.        WARN 5.        INFO 6.    ...