---
title: How to use API in a test case?
description: "Bq Platform provides its user with the below methods to create their tests : - switch between web and mobile - use API in tests Here’s how you can use API in your test. ### **Instructions :** 1. Navigate to…"
url: "https://bqurious.com/docs/how-to-use-api-in-a-test-case/"
updated: "2021-03-18"
category: How to Guides
---

# How to use API in a test case?

Bq Platform provides its user with the below methods to create their tests :

- switch between web and mobile
- use API in tests

Here’s how you can use API in your test.

### **Instructions :**

1. Navigate to the test case screen.
2. Create an API Business Component by selecting ‘Type’ as *API*instead of UI.
   ![](https://i0.wp.com/bqurious.com/wp-content/uploads/2021/03/Type-API.png?w=1200&ssl=1)
3. Click on *Test Steps* tab.
4. Add appropriate details in the API component like :
   - Group Name
   - Request Type
   - Request URL
   - Authentication (if any)
   - meta data under Header Parameters tab
   - meta data under Query Parameters tab
   - meta data under Body Parameters tab
   - meta data under Extract & Store tab
   - meta data under Assertions tab

     ![](https://i0.wp.com/bqurious.com/wp-content/uploads/2021/03/Api-comp.png?w=1200&ssl=1)
5. Save the component.
6. Create a test case (Web or Mobile) like you normally do.
7. Click on Test Steps tab.
8. Call the API component in the test case wherever required, just like you call a UI type business component.

   ![](https://i0.wp.com/bqurious.com/wp-content/uploads/2021/03/Calling-API-component_Crave.png?w=1200&ssl=1)
9. Save the test.
10. Execute the test.

**Watch an execution video :**

[API and Mobile UI in Single Test](https://www.youtube.com/embed/OdI11Cnq5IA?feature=oembed)

### *Related*
