Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introducing browserstack-sdk to the sample repo #24

Merged
merged 16 commits into from
Jan 4, 2023
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,17 @@ Getting Started with Appium tests in TestNg on BrowserStack couldn't be easier!

### **Run first test :**

- Switch to `run_first_test` directory under [Android examples](android/testng-examples) or [iOS examples](ios/testng-examples)
- Follow the steps outlined in the documentation - [Get Started with your first test on App Automate](https://www.browserstack.com/docs/app-automate/appium/getting-started/java/testng)
- Switch to one of the following directories: [Android examples](android/testng-examples) or [iOS examples](ios/testng-examples)
- Run the following maven command `mvn test -P first`

### **Speed up test execution with parallel testing :**

- Switch to `run_parallel_test` directory under [Android examples](android/testng-examples/) or [iOS examples](ios/testng-examples/)
- Follow the steps outlined in the documentation - [Get Started with parallel testing on App Automate](https://www.browserstack.com/docs/app-automate/appium/getting-started/java/testng/parallelize-tests)
- Change the `parallelsPerPlatform` parameter in the `browserstack.yml` file to run your test suite in parallel - [Detailled documentation for the browserstack.yml file](https://www.browserstack.com/docs/automate/selenium/browserstack-sdk/core-concepts#sdk-configuration-file)
kamal-kaur04 marked this conversation as resolved.
Show resolved Hide resolved

### **Use Local testing for apps that access resources hosted in development or testing environments :**

- Switch to `run_local_test` directory under [Android examples](android/testng-examples/) or [iOS examples](ios/testng-examples/)
- Follow the steps outlined in the documentation - [Get Started with Local testing on App Automate](https://www.browserstack.com/docs/app-automate/appium/getting-started/java/testng/local-testing)
- Simply configure the `browserstackLocal` parameter in the `browserstack.yml` file accordingly in [Android examples](android/testng-examples/) or [iOS examples](ios/testng-examples/).
kamal-kaur04 marked this conversation as resolved.
Show resolved Hide resolved


**Note**: If you are facing any issues, refer [Getting Help section](#Getting-Help)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

import java.net.URL;

import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.MutableCapabilities;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.options.UiAutomator2Options;


public class AppiumTest {
Expand All @@ -16,7 +17,7 @@ public class AppiumTest {

@BeforeMethod(alwaysRun=true)
public void setUp() throws Exception {
DesiredCapabilities capabilities = new DesiredCapabilities();
MutableCapabilities capabilities = new UiAutomator2Options();
kamal-kaur04 marked this conversation as resolved.
Show resolved Hide resolved
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.net.URL;

import org.openqa.selenium.MutableCapabilities;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;

Expand All @@ -15,7 +16,7 @@ public class AppiumTest {

@BeforeMethod(alwaysRun=true)
public void setUp() throws Exception {
XCUITestOptions options = new XCUITestOptions();
MutableCapabilities options = new XCUITestOptions();
avinash-bharti marked this conversation as resolved.
Show resolved Hide resolved
driver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"),options);
}

Expand Down