TestProject Open SDK for Java

TestProject Open SDK For Java

TestProject Java SDK Introduction

TestProject is a free automation tool that promises to give painless automation experience. It has the feature of record and plays associated with a developer SDK. It also has the capability to build and utilize addons as per need. It is based on automation tools like Appium and Selenium.

Having said that, TestProject removes the complication of maintaining and downloading multiple browser drivers required for testing an application in various platforms and browsers. This is overcome by having an executable file that can run in the majority of browsers and devices.

TestProject has good community support where we can discuss and find answers to our queries. Some of the features of TestProject are listed below:

Simple to start automation

The record and playback features of TestProject enable you to start automation even with minimum coding knowledge. They’ve recently also added AI-powered self-healing capabilities to their recorder, making test creation seamless, even for the most complex applications (such as Salesforce).

Supports teamwork

The sharing of test cases and scripts among team members is uncomplicated and effortless in TestProject.

Flexibility

TestProject automatically provides a library of resources. These addons can be improvised and also new ones can be created to simplify our work.

Supports multiple browsers and platforms

TestProject can test in any platform like Linux, Windows or Mac, and even Docker. It supports the testing of mobile apps in both ios and android. Also, it supports the majority of browsers like Chrome, Firefox, and so on.

Stable technology

TestProject is based on Appium and Selenium which are efficient and proven technology in the field of automation.

No need to purchase a license

TestProject with all its features is 100% free to use and requires no commercial license.

Apart from the above features, TestProject has some unique characteristics as listed below:

  • TestProject gives the option to expand the framework by utilizing the addons shared by other users on the platform.
  • TestProject is the first SaaS automation framework created for the agile team structure. Also, it comes absolutely free.
  • TestProject encourages team collaboration with respect to building and sharing a robust automation framework.
  • Out-of-the-box automatic test reports and dashboards in HTML/PDF format (including screenshots).

TestProject does not require strong technical and coding know-how to start with as it has excellent built-in recording capabilities. But for those who love to code – you can also find their Selenium and Appium powered developer SDK for Java, Python, and C#. In this tutorial, we will focus on the Java OpenSDK.

Installation steps

For the installation of the TestProject in our system, we have to first create an account. Please note, the account creation is easy and comes free of cost. We need to create the account using this link

TestProject Free Signup

Click on the Free Sign Up button. Now we have to provide details like name, mailing address, password, and agree to the terms and conditions and finally again click on the Sign-Up button.

TestProject Create Account

Once the account is created with TestProject, we need to perform some more steps to complete the installation process. We need to login to the TestProject site and navigate to the Agents tab which resides on the top of the screen and then select the operating system on which we want to complete the installation.

TestProject Manage Agents

Next, we need to download the agent executable file. Once the download is done, we can do the installation of the TestProject agent in our machine. Then we have to make sure the TestProject agent is up and running on our machine.

Start the TestProject Agent

On a Windows platform, the simple method to execute the TestProject agent is to search for TestProject in the Windows search bar. Once the Agent gets displayed, we need to click on it. This will trigger the agent to start and the status will be displayed on right-clicking the icon in the System tray.

TestProject Start Agent

TestProject Agent Registration

Once we have checked that the agent is running without issues, we need to navigate to the TestProject home page and click on the Agents menu and then select the REGISTER AN AGENT link.

TestProject Agent Registration

A pop-up window will appear, where we need to give the agent an alias. We need to populate a relevant name since in the future we may need to share the agent among the team members. Finally, we need to click on the Register button. This will register our agent with the TestProject application and we are all set, to begin with, TestProject.

To get started, we must have the Java Development Kit (JDK) version 11 installed in our system and fetch the development kit from SDK/ integration page.

Installation in a Maven Project

For a project, built-in Maven, the pom.xml should contain the below code:

Installation in a Gradle Project

For a project, built-in Gradle, the build.gradle should contain the below code:

How to create TestProject-powered Selenium Test

TestProject driver implementation is similar to a Selenium driver. Mostly they differ in the import statements. Let us know how to set up a TestProject version of ChromeDriver.

Please note we need to build a development token for running the below test. Also, the developer token needs to use the SDK by either configuring it as an environment variable or keeping it in the driver constructor.

To get the Developer taken, navigate to the following link:

https://app.testproject.io/#/integrations/sdk

TestProject Developer Key

Select the SDK [Java/ C# or Python] and then click on the Display token link inside the Get a developer token field.

TestProject SDK overrules the common Selenium/ Appium drivers with enhanced features. Let us see the package structure with all the drivers that are supported by TestProject SDK.

TestProject SDK Driver

TestProject SDK drivers support web, android, and ios platforms. For the web, the list of drivers that are available in the TestProject are listed below:

  • EdgeDriver
  • ChromeDriver
  • InternetExplorerDriver
  • SafariDriver
  • FirefoxDriver
  • RemoteWebDriver

For the android, the driver that is available in the TestProject is:

  • AndroidDriver

For the ios, the driver that is available in the TestProject is:

  • IOSDriver

Test Reports walkthrough

The reports are available on the TestProject homepage and it resides on the top of the screen with the Reports menu. They can be downloaded and emailed with other stakeholders in the team and higher management. The report generation is an important feature as it helps to conclude on the quality of the application and also for debugging.

TestProject Reports

The reports that are run individually in TestProject are described below:

TestProject Reports Overview

Image source: https://docs.testproject.io/reports/individual-run-reports

The report contains all the details including the date, time, duration of test execution, executed by and percentage of test cases passed, failed, skipped, suspended, error.

You can also export this report as a PDF.

Test Reports Generation Automatically

The test reports are generated by default as a test terminates or the driver session is no longer active. These default characteristics can be overruled by disabling the reports feature in TestProject.

To identify that a test has come to an end, the call stack is traversed to find the annotated methods. As the test execution for the annotated method begins and prior detected finishes, the test end is terminated.

All unit testing frameworks are numbered by having an independent test in the report for all the annotated methods.

The developer token needs to use the SDK by either configuring it as an environment variable or keeping it in the driver constructor.

Code Implementation in JUnit that shall produce three tests in the reports.

TestProject Report Generation Path

Above shows the by default report generation from the JUnit code.

Test Reports Generation Manually

To generate test reports manually, we need to use driver.report ().tests () method and its overloaded methods. Also, it is mandatory to disable automatic reporting when we want to generate a manual report to avoid a clash. We have to add the below code for the manual report.

A ClosableTestReport object is returned from the driver.report ().test () method. A direct call to the submit () method is required for sending the report.

Let us see an example where a closable object is used in a scenario where an exception is thrown due to the element not being available in DOM [absence of a web element with id lnk in DOM]. The test case fails but before that closable object gets closed and the test result gets reported.

Test Steps

The test steps are reported by default when driver commands are run. This feature can be disabled, or in addition, manual reports can be generated. For example,

Reports disable

In case the report has not been disabled during the driver creation, it can be enabled or disabled in the later stages as per need. Having said that, if it is clearly disabled at the time of driver initiation, it is not possible to enable it later.

To disable all reporting, the below code has to be added. We have to pass a true value to the disableReports () method.

To disable the test with automatic reporting, the below code has to be added. Every test step will be in one report. This will not happen only if a manual test report is being generated with driver.report ().tests (). We have to pass a true value to the disableTestAutoReports () method.

To disable driver commands reporting, the below code has to be added. There will be no steps available in the report. This will not happen only if a manual test report is being generated with driver.report ().step (). We have to pass a true value to the disableCommandReports () method.

While reporting driver commands, SDK does redaction of the delicate data which is passed over a secured element. This is mainly seen either with the element which has a type attribute set to password in the HTML or with XCUITest on iOS platform on an element with type XCUIElementTypeSecureTextField.

The values delivered to these elements are represented by three asterisks (***). This feature can be disabled by adding the below code. We have to pass a true value to the disableRedaction () method.

How to create TestProject-powered Appium Tests

Let us create a simple Appium automated test case for Android. First of all, we have to get all the Android driver capabilities needed for the device under test and application under test. These capabilities initiate the Android driver which will call multiple Appium actions on mobile applications.

To work on various activities, Appium should be able to identify the elements with any of the locators’ available like id, class, CSS selector, and so on [By.id/ By.cssSelector].

The developer token needs to use the SDK by either configuring it as an environment variable or keeping it in the driver constructor.

Code Implementation with Appium in TestProject.

Conclusion

In this article, we have discussed at length on TestProject, its features, and what makes it so significant. We have seen its detailed installation steps and how to configure it in our local system.

We have created basic tests with Selenium and Appium in TestProject. Also, we have explored TestProject reports and how to do different configurations to disable reporting.

TestProject Java SDK can help you boost up your existing Selenium and Appium based tests. It is also available in Python and C#. It supports cross-platform (Linux, Windows or Mac, and even Docker).

With TestProject SDK you can save not just time but also get benefits like a beautiful dashboard which helps you to deep dive into each test step and automatic test reports in both HTML and PDF formats which helps you to view error messages, screenshots, failed steps, etc.,

Best of all it is 100% free of charge.

Why wait? Roll your sleeves up and start exploring the TestProject.

Share your experience with TestProject Java SDK in the comments below.

Related Posts:

Get our latest blog posts delivered to your inbox

Subscribe and get popular blog posts about software testing industry.

Rajkumar

Leave a Comment

Share via
Copy link
Powered by Social Snap