Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

How to Log into TestRail API With SoapUI?

#1

Hi,

I am trying to do a proof of concept in SOAPUI to connect to the TestRail API but when I send the GET to view a test case, including username & Password in the headers, the response contains login page requesting username & password.
I have also tried an API key in place of the password.

How can I get past the test rail login page with SOAPUI?

0 Likes

#2

I just tried this with SoapUI, and it looks like it misinterprets the URL. Here’s what I did:

  1. In SoapUI select File -> New REST Project (or click the REST icon)
  2. Enter the full URL for an API call, like get_statuses (https://<testrail.host.name>/index.php?/api/v2/get_statuses. In the request window note that Endpoint is the host, resource is /index.php and the /api part is listed as parameter. This is incorrect.
  3. Add the “?/api/ …” part of the request to the end of the resource, so it will now be /index.php?/api/v2/get_statuses
  4. Select /api/v2/get_statuses from the parameters and click X to delete. Click Yes on the confirmation.
  5. Click the Headers tab and add Content-type with a value of application/json
  6. Click the Auth tab, select Add New Authorization from the dropdown
  7. Select Basic and click OK.
  8. Enter a valid username and password (or API key). I also think you need to select the “Authenticate pre-emptively” radio button.

Now when you make the request it should work.

1 Like