TestProject Forum

Importing the existing framework into Project.io

HI There,

We have an Automation framework developed for our organization. we have used following technologies in our existing framework.

  1. Appium
  2. cucucmber
  3. TestNG
  4. Maven

We are thinking to import the existing framework into Project.io. I have followed the steps mentioned on one article like replacing the driver package and adding the maven dependency, that is done from my end. We are using maven commands to execute out test cases which triggers the xml file and executes the test cases.

Can you please help me out with the steps to proceed further. Let me know if any more details are required around project from my side.

Hey @pranay,

Are you experiencing any problems/issues?

To integrate TestProject with your framework, you need to use the TestProject OpenSDK, meaning using the Maven/Gradle dependency in your pom.xml or build.gradle,

In this case, since you’re using Maven, it would be:

<dependency>
  <groupId>io.testproject</groupId>
  <artifactId>java-sdk</artifactId>
  <version>0.65.3-RELEASE</version>
</dependency>

And then proceed to use any of the drivers from the TestProject SDK, instead of the drivers provided by the Selenium/Appium dependencies, everything you need is included in the TestProject SDK.

Since you’ve put an emphasis on Appium, these would be the Android and iOS drivers from the SDK:

import io.testproject.sdk.drivers.android.AndroidDriver;
import io.testproject.sdk.drivers.ios.IOSDriver;

Your local TestProject agent, will take care of setting up the Appium server for you.

Once you use the drivers from the TestProject SDK your driver commands and tests will be reported into TestProject automatically, no matter how you execute your tests, just make sure you have an agent up and running.

The TestProject OpenSDK easily integrates with existing testing frameworks, like JUnit and TestNG and is even able to automatically report their respective assertion errors in your tests onto the platform via implementing each one’s respective interface and method from the SDK reporting extensions.

For TestNG, in order to integrate it’s assertion error reporting, your test class will need to implement the following interface, in addition you will need to annotate your class with the TestNG @Listener annotation and direct it to the reporter from the SDK, for example:

import io.testproject.sdk.interfaces.testng.ExceptionsReporter;

@Listeners(io.testproject.sdk.internal.reporting.extensions.testng.ExceptionsReporter.class)
public class ExplicitReportTest implements ExceptionsReporter

Implementing this interface requires the class to implement the following method:

ReportingDriver getDriver();

The method should provide access to the driver that is used for reporting.

Of course, that’s only for the assertion reporting, if you’re using TestNG to run your tests, they will already be reported into TestProject automatically without having to integrate anything, provided they are under the TestNG @Test annotation.

In addition, TestProject can also integrate with BDD frameworks, such as Cucumber for Java, SpecFlow for C# and Behave for Python,

In the case of Cucumber, you’ll just need to use the CucumberReporter plugin from the SDK in your configuration, or in the CucumberOptions annotation etc.

--plugin io.testproject.sdk.internal.reporting.extensions.cucumber.CucumberReporter

Once you do, Gherkin syntax Cucumber steps will be reported onto the platform for your executions.

You can find more details about each of these topics in the TestProject documentation, or the SDK’s GitHub page.

These links should be relevant for you:

  1. GitHub - testproject-io/java-opensdk: TestProject Java OpenSDK ← Information about the SDK in general, contains details about using TestNG and Cucumber with the SDK, along with examples for mobile testing using the drivers from the SDK in different frameworks, like JUnit 4/5, TestNG and Cucumber.
  2. https://docs.testproject.io/testproject-sdk/behavior-driven-development/cucumber-java ← More details on Cucumber from the BDD documentation page.

If you need help with anything, feel free to reach out to us via our support email address at:
support@testproject.io

Or via the built-in chat inside the platform:

image