# End to end automation with API

FinalRun empowers you to build comprehensive automation flows that seamlessly connect your backend APIs with your mobile application's user interface. This powerful capability allows you to simulate real-world user journeys, ensuring the integrity of complex interactions across your entire system.

***

{% embed url="https://youtu.be/DajXI94Tx2Y" %}



**1. Hit API and Extract Data** [0:18](https://www.google.com/url?sa=E\&q=https%3A%2F%2Fyoutu.be%2FDajXI94Tx2Y%3Ft%3D18)

* Make a GET API call to retrieve coupon code information.
* Extract the offerCode (e.g., "TEST50") and offerDiscount (e.g., "50") from the API response body. This data will be used in subsequent UI steps.

**2. Navigate to Apply Coupon Screen** [0:57](https://www.google.com/url?sa=E\&q=https%3A%2F%2Fyoutu.be%2FDajXI94Tx2Y%3Ft%3D57)

* Tap on the "Coupons & Offers" section on the cart page to navigate to the "Apply Coupon" screen.

**3. Enter Coupon Code** [1:10](https://www.google.com/url?sa=E\&q=https%3A%2F%2Fyoutu.be%2FDajXI94Tx2Y%3Ft%3D70)

* Locate the "Enter Coupon" input field on the "Apply Coupon" screen.
* Automatically enter the offerCode (e.g., "TEST50") extracted from the API into this field.

**4. Apply Coupon Code** [1:21](https://www.google.com/url?sa=E\&q=https%3A%2F%2Fyoutu.be%2FDajXI94Tx2Y%3Ft%3D81)

* Tap the "Apply" button to apply the entered coupon code. The system will identify the correct "Apply" button associated with the coupon field.

**5. Verify Coupon Application Confirmation** [1:45](https://www.google.com/url?sa=E\&q=https%3A%2F%2Fyoutu.be%2FDajXI94Tx2Y%3Ft%3D105)

* Verify that a pop-up appears displaying "Coupon Applied!" and showing the applied coupon code (e.g., "TEST50").
* Confirm the presence of a "Great!" message, indicating successful application. Tap on "Great!" to dismiss the pop-up.

**6. Verify Discount Amount in Bill Details** [2:20](https://www.google.com/url?sa=E\&q=https%3A%2F%2Fyoutu.be%2FDajXI94Tx2Y%3Ft%3D140)

* Confirm that the "Bill Details" section on the cart page shows an "Offer Discount" corresponding to the offerDiscount value extracted from the API (e.g., "-₹50"). This verifies that the discount has been correctly applied to the cart total.
