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.
The changes between the versions and the upgrade steps (if necessary) are described in the CHANGELOG. If you already have a version of the toolkit in use, please have a look at the CHANGELOG.
Please visit our Page Showcase to learn more about the different Parts of the Toolkit and how its working
Download this project to get started. There should be all inside this Project what you need for a fast start.
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.
Open the file target/site/allure-maven.html in Chrome
**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.**
and optional the other 2 Dependencies for DB-Connections
pom.xml:
<dependency>
<groupId>com.selenium-toolkit</groupId>
<artifactId>selenium-java-toolkit-testNg-pro</artifactId>
<version>1.3.26</version>
<scope>test</scope>
</dependency>
pom.xml:
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<aspectj.version>1.8.10</aspectj.version>
</properties>
pom.xml:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
<suiteXmlFiles>
<suiteXmlFile>src\test\resources\SampleTestConfig.xml</suiteXmlFile>
</suiteXmlFiles>
<systemProperties>
<property>
<name>projectArtifactId</name>
<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.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<reporting>
<excludeDefaults>true</excludeDefaults>
<plugins>
<plugin>
<groupId>com.selenium-toolkit</groupId>
<artifactId>allure-maven</artifactId>
<version>2.10_acl_2.8.1-1.3.23</version>
</plugin>
</plugins>
</reporting>
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.
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=".*"/> <!-- here you can define group-names -->
</run>
</groups>
<packages>
<package name="com.seleniumToolkit.selenium.test.*"/>
</packages>
</test>
</suite>
mvn test site
if you don't want to see old runs or use Allure-Jenkins-Plugin, add clean:
mvn clean test site
Open the file target/site/allure-maven.html
If you want you can define Categories, please see doku in link.