API Testing in Provar

API testing may sound scary and difficult for you. But there really is no need for that! API tests are used to test business logic, and you can easily add them to the Provar test automation tool. Wonder how? We’ll show you.

Why API?

API testing is an efficient way to check your Salesforce business logic. It’s easy and faster than UI testing.

The Possibilities

In Provar, you can use API tests in a simple way. You just drag and drop an object in your Provar interface to the testing area. Once dropped, you can choose from several API options:

Query Object: Select this option if you want to search in your Salesforce data.
Create: Select this option if you want to create an object record in your test.
Update: Select this option if you want to update an object record.
Delete: Select this option to delete an object record during your test.

The Scenario

Off course, before we start with the dragging and dropping part, we want to know what we want to test. Let’s take for example a Case Lifecycle scenario. Let’s assume the cases in your Salesforce environment can have three stages: New, In Progress and Closed. When a case is created, the status needs to be set by default to ‘New’. And you want to be sure the status can be changed to ‘In Progress’, and afterwards in ‘Closed’. Once you closed the case, it should not be possible to reopen it again.

The Plan

Now, we want to translate this scenario into Provar API testing language. To execute the scenario we need to build this in Provar:

1. Create a Case
2. Read the Case and check the Status = ‘New’
3. Update the Case to Status ‘In Progress’
4. Read the Case and check the Status = ‘In Progress’
5. Update the Case to Status ‘Closed’
6. Read the Case and check the Status = ‘Closed’
7. Update the Case to Status ‘In Progress’ and check for an error

The Testcase

Once your plan is ready, you just have to drag and drop, define the status, and define the error that should appear. And your testcase is ready!

This is what your testcase looks like in the Provar interface. To the right you see details about step 2 of your test plan.

More Testing

As enthusiastic as we are? Great! Next time we’ll show you some more about UI testing in Provar.

Stay posted