Skip to content

Commit f8ff5f5

Browse files
committed
Updating Readme with Local test
1 parent eda6352 commit f8ff5f5

File tree

1 file changed

+47
-8
lines changed

1 file changed

+47
-8
lines changed

README.md

Lines changed: 47 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This repository demonstrates how to run Appium Java tests on BrowserStack App Au
1919

2020
### Install the dependencies
2121

22-
1. Run the following command in the project's base folder
22+
To install the dependencies, run the following command in the project's base folder
2323

2424
```cmd
2525
mvn clean install
@@ -29,7 +29,9 @@ mvn clean install
2929

3030
Getting Started with Appium tests in Java on BrowserStack couldn't be easier!
3131

32-
### Upload your Android or iOS App
32+
### Run your first test :
33+
34+
**1. Upload your Android or iOS App**
3335

3436
Upload your Android app (.apk or .aab file) or iOS app (.ipa file) to BrowserStack servers using our REST API. Here is an example cURL request :
3537

@@ -43,9 +45,7 @@ Ensure that @ symbol is prepended to the file path in the above request. Please
4345

4446
**Note**: If you do not have an .apk or .ipa file and are looking to simply try App Automate, you can download and test using our [sample Android app](https://www.browserstack.com/app-automate/sample-apps/android/WikipediaSample.apk) or [sample iOS app](https://www.browserstack.com/app-automate/sample-apps/ios/BStackSampleApp.ipa).
4547

46-
### **Run first test :**
47-
48-
Open `BrowserStackAndroid.java` file in the `android` directory or `BrowserStackiOS.java` in the `ios` directory
48+
**2. Open `BrowserStackAndroid.java` file in the `android` directory or `BrowserStackiOS.java` in the `ios` directory :**
4949

5050
- Replace `YOUR_USERNAME` & `YOUR_ACCESS_KEY` with your BrowserStack access credentials
5151

@@ -71,11 +71,50 @@ Open `BrowserStackAndroid.java` file in the `android` directory or `BrowserStack
7171
7272
- You can access the test execution results, and debugging information such as video recording, network logs on [App Automate dashboard](https://app-automate.browserstack.com/dashboard)
7373
74-
For more details, refer to our documentation - [Get Started with your first test on App Automate](https://www.browserstack.com/docs/app-automate/appium/getting-started/java)
74+
---
75+
76+
### Use Local testing for apps that access resources hosted in development or testing environments :
77+
78+
**1. Upoad your Android or iOS App**
79+
80+
Upload your Android app (.apk or .aab file) or iOS app (.ipa file) that access resources hosted on your internal or test environments to BrowserStack servers using our REST API. Here is an example cURL request :
81+
82+
```
83+
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
84+
-X POST "https://api-cloud.browserstack.com/app-automate/upload" \
85+
-F "file=@/path/to/apk/file"
86+
```
87+
88+
Ensure that @ symbol is prepended to the file path in the above request. Please note the `app_url` value returned in the API response. We will use this to set the application under test while configuring the test later on.
89+
90+
**Note**: If you do not have an .apk or .ipa file and are looking to simply try App Automate, you can download and test using our [sample Android Local app](https://www.browserstack.com/app-automate/sample-apps/android/LocalSample.apk) or [sample iOS Local app](https://www.browserstack.com/app-automate/sample-apps/ios/LocalSample.ipa).
91+
92+
**2. Open `BrowserStackAndroidLocal.java` file in the `android` directory or `BrowserStackiOSLocal.java` in the `ios` directory :**
93+
94+
- Replace `YOUR_USERNAME` & `YOUR_ACCESS_KEY` with your BrowserStack access credentials
95+
96+
- Replace `bs://<app-id>` with the URL obtained from app upload step
97+
98+
- Set the device and OS version
99+
100+
- If you have uploaded your own app update the test case
101+
102+
- To run the test, use the following command in the base directory :
103+
104+
- For Android test, run
75105
76-
### **Use Local testing for apps that access resources hosted in development or testing environments :**
106+
```cmd
107+
mvn test -P android-local-test
108+
```
109+
110+
- For iOS test, run
111+
112+
```cmd
113+
mvn test -P ios-local-test
114+
```
115+
116+
- You can access the test execution results, and debugging information such as video recording, network logs on [App Automate dashboard](https://app-automate.browserstack.com/dashboard)
77117
78-
Refer to our documentation - [Get Started with Local testing on App Automate](https://www.browserstack.com/docs/app-automate/appium/getting-started/java/local-testing)
79118
80119
## Integration with other Java frameworks
81120

0 commit comments

Comments
 (0)