|  | 
| 1 | 1 | # Self Heal Demo (TestNG) | 
| 2 | 2 | 
 | 
| 3 | 3 | ## Overview | 
| 4 |  | -This repository contains demo scripts and configuration for testing the self-healing feature on BrowserStack using Appium and TestNG. It includes two main components: | 
|  | 4 | +This repository contains demo scripts and configuration for testing the self-healing feature on BrowserStack using Appium and TestNG. It includes two main flows: | 
| 5 | 5 | 
 | 
| 6 |  | -### 1. Base App (BaseApp.apk) | 
| 7 |  | -- The base Android app used for automation and self-healing tests. | 
|  | 6 | +### 1. Base App Flow | 
|  | 7 | +- Uses the **BaseApp.apk** for standard automation tests without self-healing. | 
| 8 | 8 | - Located at: `android/testng-examples/BaseApp.apk` | 
| 9 |  | -- This app serves as the reference for normal (non-self-healing) test runs. | 
|  | 9 | +- Demonstrates normal automation behavior and serves as a reference for comparison. | 
| 10 | 10 | 
 | 
| 11 |  | -### 2. Self-Heal App (SelfHealApp.apk) | 
| 12 |  | -- The self-healing version of the app, built to demonstrate BrowserStack's self-heal capabilities. | 
|  | 11 | +### 2. Self-Heal App Flow | 
|  | 12 | +- Uses the **SelfHealApp.apk** to showcase BrowserStack's self-heal capability. | 
| 13 | 13 | - Located at: `android/testng-examples/SelfHealApp.apk` | 
| 14 |  | -- Used to validate how the self-heal feature recovers from locator changes or UI modifications. | 
|  | 14 | +- **Run sessions with and without self-heal enabled** to observe how the feature recovers from locator changes or UI modifications: | 
|  | 15 | +  - **Without self-heal:** Tests may fail if locators change. | 
|  | 16 | +  - **With self-heal:** Tests should pass even if some locators have changed, as self-heal attempts to find the correct elements automatically. | 
| 15 | 17 | 
 | 
| 16 |  | -## Test Scenarios Demonstrated | 
| 17 |  | -- This repository includes two different test suites: | 
| 18 |  | -  - **Base App Test Suite:** Runs against the base app to show standard automation behavior without self-healing. | 
| 19 |  | -  - **Self-Heal App Test Suite:** Runs against the self-heal app with self-healing enabled to demonstrate how tests recover from locator changes or UI modifications. | 
| 20 |  | -- The test names will differ between the two suites to clearly indicate which scenario is being executed (e.g., `BaseAppTest` vs `SelfHealAppTest`). | 
| 21 |  | -- By comparing the results of these two test suites, you can clearly observe the benefits of the self-heal feature. | 
| 22 |  | - | 
| 23 |  | -## How to Check Differences | 
| 24 |  | -- Run your test suite with both the base app and the self-heal app. | 
| 25 |  | -- Compare the results and logs: with self-heal enabled, tests should pass even if some locators have changed, while they may fail without self-heal. | 
| 26 |  | -- You can also use diff tools to compare the APKs or source code if needed. | 
|  | 18 | +## How to Compare | 
|  | 19 | +- Run your test suite on the Self-Heal App twice: once with `selfHeal: false` and once with `selfHeal: true` in your `browserstack.yml`. | 
|  | 20 | +- Compare the results and logs to see the impact of self-healing. | 
| 27 | 21 | 
 | 
| 28 | 22 | ## About the Self-Heal Feature | 
| 29 | 23 | - The self-heal feature in BrowserStack automatically detects and recovers from locator changes in your app's UI during automated tests. | 
|  | 
0 commit comments