Hi, we have licensed version of Botium Box. Now we wanted to read all projects/test sets/test cases & test results information from Botium Box using REST API. Please let me know if this is possible.
If yes, please let me know complete REST API documentation along with HTTP request Headers, Methods to form a proper HTTP Request to get response.
I have found Botium Box Playground as an interface to build queries and get response within Graphql. But couldn’t use them in our Java REST application to build the same query and get response.
Kindly help me out with this statement. Thanks.
Botium Box exposes a GraphQL API (Using the Botium Box GraphQL API - Botium Box Wiki). I suggest to use a client library capable of doing GraphQL requests.
Thanks Florian,
I am able to retrieve Projects/Test Sets/Test Sessions by using GraphQL API queries. But I couldn’t find queries to retrieve Test Results by Project & Test Results by Test Set. Please let me know if any direct document available with all queries or let me know the specific GraphQL queries to read Test Results.
That’s the magic of GraphQL, it allows very fine grained queries out-of-the-box. For getting test results by test sets, the query would be like this:
testsessions(where: { testSets_some: { id: 'my-test-set-id } }) { id name }
And for getting test results by test project:
testsessions(where: { testProject: { id: 'my-test-project-id' } }) { id name }
@Chidvilas I would be curious to know what you are trying to achieve, as an inspiration to the community here
Thanks for the share Florian,
Unfortunately I am not getting the response as I expected. I am expecting the response should contain the full test case execution result information with linked test set/test project name for a specific test case.
Have tried the both queries which you suggested and got the below as response.
Query : query {testsessions(where: { testProject: { id: ‘my-test-project-id’ } }) { id name }}
Response :
{
“data”: {
“testsessions”: [
{
“id”: “Test Session ID”,
“name”: “Test Session Name”
}
]
}
}
Query : query {testsessions(where: { testSets_some: { id: ‘my-test-set-id’ } }) { id name }}
Response :
{
“data”: {
“testsessions”: [
{
“id”: “Test Session ID”,
“name”: “Test Session Name”
}
]
}
}
instead, I am expecting all fields information of a test case result linked with a Test Set/Test Project. Kindly validate my question and let me know if I could get expected response.
that’s a matter of the result field selection. In the examples above, only id and name are selected. you can select all other fields including all relations to the results, test projects, test sets etc
1 Like
Hi Florian , GraphQL is working fine and I am able to retrieve required information.
Thank you.
1 Like