Knowledge Base Article

Home Page > Knowledge Base > Spira Platform > RemoteLaunch

Home Page > Knowledge Base > Spira Platform

Home Page > Knowledge Base > Spira Platform > SpiraTeam

Home Page > Knowledge Base > Spira Platform > SpiraTest

Article Running Selenium WebDriver Scripts using RemoteLaunch and TestNG

by Adam S on Thursday, June 4, 2015

This article explains the process for running Selenium WebDriver test scripts written in Java using TestNG, RemoteLaunch and SpiraTest.


Unlike running Selenium IDE scripts through WebDriver, You don't use the Selenium plugin for RemoteLaunch, instead you should use the TestNG plugin (see that will let Selenium tests written in Java / TestNG report back to SpiraTest and then use the Command-Line plugin for RemoteLaunch to actually initiate the execution of the test scripts.

Using TestNG with SpiraTest

To have TestNG report back to SpiraTest, you simply use the TestNG listener that comes with our extension and use that in conjunction with the special @SpiraTestCase attribute on the Java class to denote which test case in SpiraTest the results should be associated with.

You can then run this TestNG script from the command line using Java.exe or use an IDE such as Eclipse. If you are using Eclipse, make sure to execute as a Java application not a TestNG test, since the built-in TestNG runner for Eclipse doesn't support custom listeners (or not at time of writing).

An example command-line to use would be:

java.exe -classpath "C:\selenium-2.0.0\libs\selenium-java-2.33.0.jar; C:\Program Files\SpiraTestNGListener\TestNGListener.jar; C:\Program Files\TestNG-5.7\testng-5.7\testng-5.7-jdk15.jar" org.testng.TestNG -listener com.inflectra.spiratest.addons.testnglistener.SpiraTestListener com\inflectra\spiratest\addons\testnglistener\samples\unittests.xml

Using RemoteLaunch to Execute

Once you have the basic TestNG setup in place reporting back to SpiraTest, you can simply use the Command-Line plugin for RemoteLaunch to kick off the TestNG test harness. All of the reporting back to SpiraTest is usually left to the TestNG test fixtures themselves.

Article Info
Last Updated: 6/4/2015
Article ID: KB148
# Views: 1175
Powered by KronoDesk v1.1.0.15 | © Copyright Inflectra Corporation 2011-2016 | Licensed to Inflectra Corporation.