TestProject Forum

API: Not able to get reports for tests executed via SDK

Hi all,
i am trying to import test reports into ELK and XRay.
I have no issue in getting the reports and importing them BUT only for jobs defined in testproject.
Hence, i cannot get the report for tests that have been executed via the SDK as there is no associated job within testproject.
I saw that there is a way to delete all reports for a given project, hence it should be possible to get all report for a given project.
Please advice.

Hello @bernd.bornhausen,

When Initializing the ChromeDriver (or any other driver) with the TestProject constructor, you can pass a “jobName” and “projectName” parameter.

So you can go to your project and create a new job in the TestProject web platform, and then take the project name and job name and pass them to the constructor.

After the test finishes the report will be generated to the TestProject cloud, and will be visible in the reports section under the Project and job your provided.

Then you can get the report of the latest execution of that job using this API endpoint:
https://api.testproject.io/docs/v2/#/Reports/Reports_GetV2ProjectsByProjectIdJobsByJobIdReportsLatest

Hi Artem,
just realized what happened:
When launching a SDK test the project and job will be created by the SDK, so reporting should not be a problem.
Issue is if someone, like in my case myself, does do a cleanup of the jobs, i cannot export the reports anymore via API as the link between the report and the job is maintained via the job id. Hence recreating the job (manually or via SDK) does not solve the issue.
Hence multiple improvement requests:
1.provide API endpoints to export reports based on ‘folder name’ and ‘project ID’.
like so:
/v2/projects/{projectId}/reports/folders - gives back a list of folders with their name and ID
/v2/projects/{projectId}/reports/folders/{folderID} - gives back the reports stored in the folder.
this way we could iterate over the report folders of a given project independent of the job; which might have been deleted.

  1. via the SDK:
    Currently:
    The SDK looks for the job based on the name provided in the constructor. If it does find the job, it take the job-id and stores the report in the associated folder. If the job does not exist, it creates a new one and a new report folder. In case the report folder did exists before, but the job has been deleted, it creates a second folder with the same name.
    Possible enhancement: verify if the job name exists as a report folder, if yes, take the ID and report into it.
    If not: ‘recreate’ the job with the same ID. This would avoid double folder names and would allow for more streamlined reporting.

Thanks,
Bernd