A 64-bit version of the Java Virtual Machine (JVM) is recommended for the best performance of your server-based applications with qTest SDK for Java. This JVM runs only in Server mode, even if you specify the -Client option at run time. Using the 32-bit version of the JVM with the -Server option at run time should provide comparable performance to the other one.
Install the qTest SDK for Java
Download qTest SDK for Java from qTest SDK web page from qTest Resource menu and extract the contents into the working directory.
Programming with qTest RESTful web service
This section contains general programming techniques and information for developing applications with qTest SDK for Java.
Client Networking Configuration
The qTest SDK for Java allows you to change the default client configuration, which is helpful when you want to:
Connect to the Internet through a proxy
Modify HTTP transport settings, such as connection timeout and request retries.
Specify TCP socket buffer size hints
When constructing a client object, you can pass in optional org.qas.api.ClientConfiguration object to customize the client’s configuration.
If you’re connecting to the Internet through a proxy server, you can configure your proxy server setting (proxy host, port and username/password) through the ClientConfiguration object.
HTTP Transport Configuration
Several HTTP transport options can be configured through the ClientConfiguration object. Default values suffice for most users, but those who want more control can modify the following configurations:
Maximum retry attempts for retry-able errors (setMaxErrorRetry, withMaxErrorRetry)
Maximum open HTTP connections (setMaxConnections, withMaxConnections)
The following sections describe different cases of exceptions that are thrown by the SDK and how to handle them appropriately.
Why Unchecked Exception?
qTest Java SDK uses runtime (or uncheck) exceptions instead of checked exceptions for a few reasons:
To provide the developers fine-grained control over the errors they want to handle without forcing them to handle exceptional cases they aren’t concerned about (and making their code over verbose)
To prevent scalability issues inherent in checked exceptions in large applications.
AuthServiceException (and Subclasses)
This is the main type of exception that you’ll need to deal with when using qTest SDK for Java. This exception represents an error responded from qTest RESTful service. For example, if you request to get a qTest TestCase that doesn’t exist, qTest DesignService will return an error response and all the details will be included in the thrown AuthServiceException. For certain case, a subclass of AuthServiceException will be thrown to provide fine-grained control over handling error cases through catch blocks.
An AuthServiceException is thrown means the request has been successfully sent to qTest RESTful service but it is unsuccessfully processed because of either errors in the request’s parameters or issues on the service side.
There are some useful fields in AuthServiceException:
Return HTTP status code.
Detailed error message from the service.
AuthServiceException also includes a field that describes whether the failed request was the caller’s fault or the qTest RESTful service’s fault.
This exception indicates that a problem occurred inside the Java client code, either while trying to send a request to qTest RESTful service or while trying to parse a response from qTest RESTful service. AuthClientException exceptions are more severe than AuthServiceException exceptions and indicate a major problem that is preventing the client from being able to make service calls to qTest RESTful services. For example, the qTest Java SDK will throw an AuthClientException if no network connection is available when the app attempts to call an operation on one of the clients.
With calling operations, if you pass an illegal argument, the qTest SDK for Java will throw an IllegalArgumentException. For example, if you call an operation and pass a null value in for one of the required parameters, the SDK will throw IllegalArgumentException describing the illegal argument.
qTest RESTful Web Service Security Credentials
qTest RESTful Web Service requires security credential to verify the account and validate the permissions to access the requested resources.
The qTest SDK for Java supports the following services:
Create and initialize a GetTestStepRequest instance. Specify the qTest project identifier (withProjectId), test case identifier (withTestCaseId), test case version (withTestCaseVersion) and test step identifier (withTestStepId), as follow:
GetTestStepRequest getTestStepRequest =
Pass the request object into getTestStep method. The method returns a TestStep object, as follow:
Create and initialize a ListTestStepRequest instance. Specify the qTest project identifier (withProjectId), test case identifier (withTestCaseId), and test case version (withTestCaseVersion), as follow:
ListTestStepRequest listTestStepRequest =
Pass the request object into listTestStep method. The method returns a list of TestStep objects, as follow:
Create and initialize a AutomationTestLogRequest instance. Specify the qTest project identifier (withProjectId), test run identifier (withTestRunId), and automation test log (withAutomationTestLog), as follow: