Selenium-Java-Toolkit-TestNg-Playground
This is the sample-Project and show you how to use the Selenium-Toolkit. The Selenium-Toolkit is a Java based test-toolkit for selenium-testing with testNg or Junit. This sample-Project shows how to use it with testNg.
The goal of the toolkit is, to support you by creating and maintainig your seleniumtests. It also give you a nice Report to have a better overview.
Instructions and Help
Please visit our Page Showcase to learn more about the different Parts of the Toolkit and how its working
Installation
Download this project to get started. There should be all inside this Project what you need for a fast start.
Run tests
mvn test site
if you don't want to see old runs or use Allure-Jenkins-Plugin, add clean:
mvn clean test site
you are also able to just click on a "Run Test" button in your IDEA and then run "mvn site" to create the Report.
Watch Report
Open the file target/site/allure-maven.html in Chrome
Add Toolkit to your existing Project
**This is the instruction, how you can add this toolkit into your existing Test-Project, if you don't want to download this Project.
If you starts on the Green or don't want to do all this things, please simply use this Project.**
Pom modifications
and optional the other 2 Dependencies for DB-Connections
pom.xml:
<dependency>
<groupId>com.selenium-toolkitgroupId>
<artifactId>selenium-java-toolkit-testNg-proartifactId>
<version>1.3.23version>
<scope>testscope>
dependency>
Define Properties
pom.xml:
<properties>
<project.build.sourceEncoding>UTF-8project.build.sourceEncoding>
<maven.compiler.source>1.8maven.compiler.source>
<maven.compiler.target>1.8maven.compiler.target>
<aspectj.version>1.8.10aspectj.version>
properties>
Configure Build and Reporting
pom.xml:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.pluginsgroupId>
<artifactId>maven-surefire-pluginartifactId>
<version>2.22.2version>
<configuration>
<testFailureIgnore>truetestFailureIgnore>
<suiteXmlFiles>
<suiteXmlFile>src\test\resources\SampleTestConfig.xmlsuiteXmlFile>
suiteXmlFiles>
<systemProperties>
<property>
<name>projectArtifactIdname>
<value>${project.artifactId}value>
property>
systemProperties>
<argLine>
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
argLine>
configuration>
<dependencies>
<dependency>
<groupId>org.aspectjgroupId>
<artifactId>aspectjweaverartifactId>
<version>${aspectj.version}version>
dependency>
dependencies>
plugin>
plugins>
build>
<reporting>
<excludeDefaults>trueexcludeDefaults>
<plugins>
<plugin>
<groupId>com.selenium-toolkitgroupId>
<artifactId>allure-mavenartifactId>
<version>2.10_acl_2.8.1-1.3.23version>
plugin>
plugins>
reporting>
Usage
Configure the Toolkit
You are able to define 2 type of Configurations:
Read more about the Configuration-Class or the TestData-Management and how to switch them. or about the Configuration-Property or the TestData-Management and how to switch them.
Define testNg xml
src\test\resources\SampleTestConfig.xml:
xml version="1.0" encoding="UTF-8"?>
DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Sample Suite">
<test name="Sample Test" parallel="methods" thread-count="1">
<groups>
<run>
<include name=".*"/>
run>
groups>
<packages>
<package name="com.seleniumToolkit.selenium.test.*"/>
packages>
test>
suite>
Run tests
mvn test site
if you don't want to see old runs or use Allure-Jenkins-Plugin, add clean:
mvn clean test site
Watch Report
Open the file target/site/allure-maven.html
Configure Report Categories (optional)
If you want you can define Categories, please see doku in link.