From f2baa82d56faa68d761c2004369c8aabbce96596 Mon Sep 17 00:00:00 2001 From: deepwired Date: Tue, 10 May 2022 09:14:17 +0530 Subject: [PATCH 1/8] created dedicated directories for java7 and java8 --- java_7/README.md | 132 +++++++++++++++ java_7/pom.xml | 160 ++++++++++++++++++ .../test/java/android/BrowserStackSample.java | 68 ++++++++ .../java/android/BrowserStackSampleLocal.java | 90 ++++++++++ .../src/test/java/ios/BrowserStackSample.java | 64 +++++++ .../java/ios/BrowserStackSampleLocal.java | 95 +++++++++++ README.md => java_8/README.md | 0 pom.xml => java_8/pom.xml | 0 .../test/java/android/BrowserStackSample.java | 0 .../java/android/BrowserStackSampleLocal.java | 0 .../test/java/ios/BrowserStackSample.java | 0 .../java/ios/BrowserStackSampleLocal.java | 0 12 files changed, 609 insertions(+) create mode 100644 java_7/README.md create mode 100644 java_7/pom.xml create mode 100644 java_7/src/test/java/android/BrowserStackSample.java create mode 100644 java_7/src/test/java/android/BrowserStackSampleLocal.java create mode 100644 java_7/src/test/java/ios/BrowserStackSample.java create mode 100644 java_7/src/test/java/ios/BrowserStackSampleLocal.java rename README.md => java_8/README.md (100%) rename pom.xml => java_8/pom.xml (100%) rename {src => java_8/src}/test/java/android/BrowserStackSample.java (100%) rename {src => java_8/src}/test/java/android/BrowserStackSampleLocal.java (100%) rename {src => java_8/src}/test/java/ios/BrowserStackSample.java (100%) rename {src => java_8/src}/test/java/ios/BrowserStackSampleLocal.java (100%) diff --git a/java_7/README.md b/java_7/README.md new file mode 100644 index 0000000..c8321a1 --- /dev/null +++ b/java_7/README.md @@ -0,0 +1,132 @@ +# java-appium-app-browserstack + +This repository demonstrates how to run Appium Java tests on BrowserStack App Automate. + +## Setup + +### Requirements + +1. Java 8+ + +- If Java is not installed, follow these instructions: + - For Windows, download latest java version from [here](https://java.com/en/download/) and run the installer executable + - For Mac and Linux, run `java -version` to see what java version is pre-installed. If you want a different version download from [here](https://java.com/en/download/) + +2. Maven + + - If Maven is not downloaded, download it from [here](https://maven.apache.org/download.cgi) + - For installation, follow the instructions [here](https://maven.apache.org/install.html) + +### Install the dependencies + +To install the dependencies, run the following command in the project's base folder + +```cmd +mvn clean install +``` + +## Getting Started + +Getting Started with Appium tests in Java on BrowserStack couldn't be easier! + +### Run your first test : + +**1. Upload your Android or iOS App** + +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 : + +``` +curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \ +-X POST "https://api-cloud.browserstack.com/app-automate/upload" \ +-F "file=@/path/to/apk/file" +``` + +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. + +**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). + +**2. Configure and run your first test** + +Open `BrowserStackSample.java` file in the `android` directory or `ios` directory : + +- Replace `YOUR_USERNAME` & `YOUR_ACCESS_KEY` with your BrowserStack access credentials. Get your BrowserStack access credentials from [here](https://www.browserstack.com/accounts/settings) + +- Replace `bs://` with the URL obtained from app upload step + +- Set the device and OS version + +- If you have uploaded your own app update the test case + +- To run the test, use the following command in the base directory : + + - For Android test, run + + ```cmd + mvn test -P android-first-test + ``` + + - For iOS test, run + + ```cmd + mvn test -P ios-first-test + ``` + +- 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) + +--- + +### Use Local testing for apps that access resources hosted in development or testing environments : + +**1. Upoad your Android or iOS App** + +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 : + +``` +curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \ +-X POST "https://api-cloud.browserstack.com/app-automate/upload" \ +-F "file=@/path/to/apk/file" +``` + +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. + +**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). + +**2. Configure and run your local test** + +Open `BrowserStackSampleLocal.java` file in the `android` or `ios` directory : + +- Replace `YOUR_USERNAME` & `YOUR_ACCESS_KEY` with your BrowserStack access credentials. Get your BrowserStack access credentials from [here](https://www.browserstack.com/accounts/settings) + +- Replace `bs://` with the URL obtained from app upload step + +- Set the device and OS version + +- Ensure that `browserstack.local` capability is set to `true`. Within the test script, there is code snippet that automatically establishes Local Testing connection to BrowserStack servers using Java binding for BrowserStack Local. + +- If you have uploaded your own app update the test case + +- To run the test, use the following command in the base directory : + + - For Android test, run + + ```cmd + mvn test -P android-local-test + ``` + + - For iOS test, run + + ```cmd + mvn test -P ios-local-test + ``` + +- 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) + + +## Integration with other Java frameworks + +- [JUnit](https://github.com/browserstack/junit-appium-app-browserstack) +- [TestNg](https://github.com/browserstack/testng-appium-app-browserstack) + +## Getting Help + +If you are running into any issues or have any queries, please check [Browserstack Support page](https://www.browserstack.com/support/app-automate) or [get in touch with us](https://www.browserstack.com/contact?ref=help). diff --git a/java_7/pom.xml b/java_7/pom.xml new file mode 100644 index 0000000..74fc8bd --- /dev/null +++ b/java_7/pom.xml @@ -0,0 +1,160 @@ + + 4.0.0 + com.browserstack + java-browserstack + 0.0.1-SNAPSHOT + java-browserstack + Java appium app browserstack + + + UTF-8 + 2.19.1 + + default + + + + + + commons-io + commons-io + 1.3.2 + + + io.appium + java-client + 7.0.0 + + + com.browserstack + browserstack-local-java + 1.0.3 + + + com.googlecode.json-simple + json-simple + 1.1.1 + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.22.2 + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 1.8 + 1.8 + + + + + + + + android-first-test + + + + org.codehaus.mojo + exec-maven-plugin + 1.1.1 + + + test + + java + + + android.BrowserStackSample + test + + + + + + + + + android-local-test + + + + org.codehaus.mojo + exec-maven-plugin + 1.1.1 + + + test + + java + + + android.BrowserStackSampleLocal + test + + + + + + + + + ios-first-test + + + + org.codehaus.mojo + exec-maven-plugin + 1.1.1 + + + test + + java + + + ios.BrowserStackSample + test + + + + + + + + + ios-local-test + + + + org.codehaus.mojo + exec-maven-plugin + 1.1.1 + + + test + + java + + + ios.BrowserStackSampleLocal + test + + + + + + + + + + \ No newline at end of file diff --git a/java_7/src/test/java/android/BrowserStackSample.java b/java_7/src/test/java/android/BrowserStackSample.java new file mode 100644 index 0000000..136ee81 --- /dev/null +++ b/java_7/src/test/java/android/BrowserStackSample.java @@ -0,0 +1,68 @@ +package android; + +import java.net.URL; +import java.util.List; +import java.util.function.Function; +import java.net.MalformedURLException; + +import io.appium.java_client.MobileBy; +import io.appium.java_client.android.AndroidDriver; +import io.appium.java_client.android.AndroidElement; + +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.remote.DesiredCapabilities; + + +public class BrowserStackSample { + + public static void main(String[] args) throws MalformedURLException, InterruptedException { + + DesiredCapabilities caps = new DesiredCapabilities(); + + // Set your access credentials + caps.setCapability("browserstack.user", "YOUR_USERNAME"); + caps.setCapability("browserstack.key", "YOUR_ACCESS_KEY"); + + // Set URL of the application under test + caps.setCapability("app", "bs://"); + + // Specify device and os_version for testing + caps.setCapability("device", "Google Pixel 3"); + caps.setCapability("os_version", "9.0"); + + // Set other BrowserStack capabilities + caps.setCapability("project", "First Java Project"); + caps.setCapability("build", "browserstack-build-1"); + caps.setCapability("name", "first_test"); + + + // Initialise the remote Webdriver using BrowserStack remote URL + // and desired capabilities defined above + AndroidDriver driver = new AndroidDriver( + new URL("http://hub.browserstack.com/wd/hub"), caps); + + + // Test case for the BrowserStack sample Android app. + // If you have uploaded your app, update the test case here. + AndroidElement searchElement = (AndroidElement) new WebDriverWait(driver, 30).until( + ExpectedConditions.elementToBeClickable( + MobileBy.AccessibilityId("Search Wikipedia"))); + searchElement.click(); + AndroidElement insertTextElement = (AndroidElement) new WebDriverWait(driver, 30).until( + ExpectedConditions.elementToBeClickable( + MobileBy.id("org.wikipedia.alpha:id/search_src_text"))); + insertTextElement.sendKeys("BrowserStack"); + Thread.sleep(5000); + List allProductsName = driver.findElementsByClassName( + "android.widget.TextView"); + assert(allProductsName.size() > 0); + + + // Invoke driver.quit() after the test is done to indicate that the test is completed. + driver.quit(); + + } + +} diff --git a/java_7/src/test/java/android/BrowserStackSampleLocal.java b/java_7/src/test/java/android/BrowserStackSampleLocal.java new file mode 100644 index 0000000..0854db1 --- /dev/null +++ b/java_7/src/test/java/android/BrowserStackSampleLocal.java @@ -0,0 +1,90 @@ +package android; + +import com.browserstack.local.Local; +import java.net.URL; import java.util.*; +import io.appium.java_client.MobileBy; import io.appium.java_client.android.*; +import org.openqa.selenium.support.ui.*;import org.openqa.selenium.remote.*; + +public class BrowserStackSampleLocal { + + private static Local localInstance; + public static String userName = "YOUR_USERNAME"; + public static String accessKey = "YOUR_ACCESS_KEY"; + + + public static void setupLocal() throws Exception { + localInstance = new Local(); + Map options = new HashMap(); + options.put("key", accessKey); + localInstance.start(options); + } + + public static void tearDownLocal() throws Exception { + localInstance.stop(); + } + + public static void main(String[] args) throws Exception { + // Start the BrowserStack Local binary + setupLocal(); + + DesiredCapabilities capabilities = new DesiredCapabilities(); + + // Set your access credentials + capabilities.setCapability("browserstack.user", userName); + capabilities.setCapability("browserstack.key", accessKey); + + // Set URL of the application under test + capabilities.setCapability("app", "bs://"); + + // Specify device and os_version for testing + capabilities.setCapability("device", "Google Pixel 3"); + capabilities.setCapability("os_version", "9.0"); + + // Set the browserstack.local capability to true + capabilities.setCapability("browserstack.local", true); + + // Set other BrowserStack capabilities + capabilities.setCapability("project", "First Java Project"); + capabilities.setCapability("build", "browserstack-build-1"); + capabilities.setCapability("name", "local_test"); + + + // Initialise the remote Webdriver using BrowserStack remote URL + // and desired capabilities defined above + AndroidDriver driver = new AndroidDriver( + new URL("http://hub.browserstack.com/wd/hub"), capabilities); + + // Test case for the BrowserStack sample Android Local app. + // If you have uploaded your app, update the test case here. + AndroidElement searchElement = (AndroidElement) new WebDriverWait(driver, 30).until( + ExpectedConditions.elementToBeClickable(MobileBy.id("com.example.android.basicnetworking:id/test_action"))); + searchElement.click(); + AndroidElement insertTextElement = (AndroidElement) new WebDriverWait(driver, 30).until( + ExpectedConditions.elementToBeClickable(MobileBy.className("android.widget.TextView"))); + + AndroidElement testElement = null; + List allTextViewElements = driver.findElementsByClassName("android.widget.TextView"); + Thread.sleep(10); + for(AndroidElement textElement : allTextViewElements) { + if(textElement.getText().contains("The active connection is")) { + testElement = textElement; + } + } + + if(testElement == null) { + throw new Error("Cannot find the needed TextView element from app"); + } + String matchedString = testElement.getText(); + System.out.println(matchedString); + assert(matchedString.contains("The active connection is wifi")); + assert(matchedString.contains("Up and running")); + + // Invoke driver.quit() after the test is done to indicate that the test is completed. + driver.quit(); + + // Stop the BrowserStack Local binary + tearDownLocal(); + + } + +} diff --git a/java_7/src/test/java/ios/BrowserStackSample.java b/java_7/src/test/java/ios/BrowserStackSample.java new file mode 100644 index 0000000..6fd9eea --- /dev/null +++ b/java_7/src/test/java/ios/BrowserStackSample.java @@ -0,0 +1,64 @@ +package ios; + +import java.net.URL; +import java.util.List; +import java.net.MalformedURLException; + +import org.openqa.selenium.support.ui.WebDriverWait; +import org.openqa.selenium.remote.DesiredCapabilities; +import org.openqa.selenium.support.ui.ExpectedConditions; + +import io.appium.java_client.MobileBy; +import io.appium.java_client.ios.IOSDriver; +import io.appium.java_client.ios.IOSElement; + +public class BrowserStackSample { + + public static void main(String[] args) throws MalformedURLException, InterruptedException { + DesiredCapabilities caps = new DesiredCapabilities(); + + // Set your access credentials + caps.setCapability("browserstack.user", "YOUR_USERNAME"); + caps.setCapability("browserstack.key", "YOUR_ACCESS_KEY"); + + // Set URL of the application under test + caps.setCapability("app", "bs://"); + + // Specify device and os_version for testing + caps.setCapability("device", "iPhone 11 Pro"); + caps.setCapability("os_version", "13"); + + // Set other BrowserStack capabilities + caps.setCapability("project", "First Java Project"); + caps.setCapability("build", "browserstack-build-1"); + caps.setCapability("name", "first_test"); + + + // Initialise the remote Webdriver using BrowserStack remote URL + // and desired capabilities defined above + IOSDriver driver = new IOSDriver( + new URL("http://hub-cloud.browserstack.com/wd/hub"), caps); + + + // Test case for the BrowserStack sample iOS app. + // If you have uploaded your app, update the test case here. + IOSElement textButton = (IOSElement) new WebDriverWait(driver, 30).until( + ExpectedConditions.elementToBeClickable(MobileBy.AccessibilityId("Text Button"))); + textButton.click(); + IOSElement textInput = (IOSElement) new WebDriverWait(driver, 30).until( + ExpectedConditions.elementToBeClickable(MobileBy.AccessibilityId("Text Input"))); + textInput.sendKeys("hello@browserstack.com"); + Thread.sleep(5000); + IOSElement textOutput = (IOSElement) new WebDriverWait(driver, 30).until( + ExpectedConditions.elementToBeClickable(MobileBy.AccessibilityId("Text Output"))); + if(textOutput != null && textOutput.getText().equals("hello@browserstack.com")) + assert(true); + else + assert(false); + + // Invoke driver.quit() after the test is done to indicate that the test is completed. + driver.quit(); + + } + +} diff --git a/java_7/src/test/java/ios/BrowserStackSampleLocal.java b/java_7/src/test/java/ios/BrowserStackSampleLocal.java new file mode 100644 index 0000000..f278a07 --- /dev/null +++ b/java_7/src/test/java/ios/BrowserStackSampleLocal.java @@ -0,0 +1,95 @@ +package ios; + +import com.browserstack.local.Local; +import java.net.URL; import java.io.File; import java.util.*; +import org.apache.commons.io.FileUtils; +import io.appium.java_client.MobileBy; import io.appium.java_client.ios.*; +import org.openqa.selenium.*; +import org.openqa.selenium.support.ui.*;import org.openqa.selenium.remote.*; + +public class BrowserStackSampleLocal { + + private static Local localInstance; + public static String userName = "YOUR_USERNAME"; + public static String accessKey = "YOUR_ACCESS_KEY"; + + + public static void setupLocal() throws Exception { + localInstance = new Local(); + Map options = new HashMap(); + options.put("key", accessKey); + localInstance.start(options); + } + + public static void tearDownLocal() throws Exception { + localInstance.stop(); + } + + + public static void main(String[] args) throws Exception { + // Start the BrowserStack Local binary + setupLocal(); + + DesiredCapabilities capabilities = new DesiredCapabilities(); + + // Set your access credentials + capabilities.setCapability("browserstack.user", userName); + capabilities.setCapability("browserstack.key", accessKey); + + // Set URL of the application under test + capabilities.setCapability("app", "bs://"); + + // Specify device and os_version for testing + capabilities.setCapability("device", "iPhone 11 Pro"); + capabilities.setCapability("os_version", "13"); + + // Set the browserstack.local capability to true + capabilities.setCapability("browserstack.local", true); + + // Set other BrowserStack capabilities + capabilities.setCapability("project", "First Java Project"); + capabilities.setCapability("build", "browserstack-build-1"); + capabilities.setCapability("name", "local_test"); + + // Initialise the remote Webdriver using BrowserStack remote URL + // and desired capabilities defined above + IOSDriver driver = new IOSDriver( + new URL("http://hub.browserstack.com/wd/hub"), capabilities); + + // Test case for the BrowserStack sample iOS Local app. + // If you have uploaded your app, update the test case here. + IOSElement testButton = (IOSElement) new WebDriverWait(driver, 30).until( + ExpectedConditions.elementToBeClickable(MobileBy.AccessibilityId("TestBrowserStackLocal"))); + testButton.click(); + + WebDriverWait wait = new WebDriverWait(driver, 30); + wait.until(new ExpectedCondition() { + @Override + public Boolean apply(WebDriver d) { + String result = d.findElement(MobileBy.AccessibilityId("ResultBrowserStackLocal")).getAttribute("value"); + return result != null && result.length() > 0; + } + }); + IOSElement resultElement = (IOSElement) driver.findElement(MobileBy.AccessibilityId("ResultBrowserStackLocal")); + + String resultString = resultElement.getText().toLowerCase(); + System.out.println(resultString); + if(resultString.contains("not working")) { + File scrFile = (File) ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); + FileUtils.copyFile(scrFile, new File(System.getProperty("user.dir") + "/screenshot.png")); + System.out.println("Screenshot stored at " + System.getProperty("user.dir") + "/screenshot.png"); + throw new Error("Unexpected BrowserStackLocal test result"); + } + + String expectedString = "Up and running"; + assert(resultString.contains(expectedString.toLowerCase())); + + // Invoke driver.quit() after the test is done to indicate that the test is completed. + driver.quit(); + + // Stop the BrowserStack Local binary + tearDownLocal(); + + } + +} diff --git a/README.md b/java_8/README.md similarity index 100% rename from README.md rename to java_8/README.md diff --git a/pom.xml b/java_8/pom.xml similarity index 100% rename from pom.xml rename to java_8/pom.xml diff --git a/src/test/java/android/BrowserStackSample.java b/java_8/src/test/java/android/BrowserStackSample.java similarity index 100% rename from src/test/java/android/BrowserStackSample.java rename to java_8/src/test/java/android/BrowserStackSample.java diff --git a/src/test/java/android/BrowserStackSampleLocal.java b/java_8/src/test/java/android/BrowserStackSampleLocal.java similarity index 100% rename from src/test/java/android/BrowserStackSampleLocal.java rename to java_8/src/test/java/android/BrowserStackSampleLocal.java diff --git a/src/test/java/ios/BrowserStackSample.java b/java_8/src/test/java/ios/BrowserStackSample.java similarity index 100% rename from src/test/java/ios/BrowserStackSample.java rename to java_8/src/test/java/ios/BrowserStackSample.java diff --git a/src/test/java/ios/BrowserStackSampleLocal.java b/java_8/src/test/java/ios/BrowserStackSampleLocal.java similarity index 100% rename from src/test/java/ios/BrowserStackSampleLocal.java rename to java_8/src/test/java/ios/BrowserStackSampleLocal.java From 7eb080f0690beeea5edd63b17bcec458664cb18e Mon Sep 17 00:00:00 2001 From: deepwired Date: Tue, 17 May 2022 09:10:19 +0530 Subject: [PATCH 2/8] updating readme.md file with links for java7 and java8 --- README.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..2a67f71 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +| [Using Java 7 with MJSONWP protocol](./java_7/README.md) | [Using Java 8 with w3c protocol](./java_8/README.md) | +|--------------------------------------------------------- | ---------------------------------------------------- | \ No newline at end of file From 6b1f7cf4f6320fec4e5913627c25ef9ff91a8711 Mon Sep 17 00:00:00 2001 From: deepwired Date: Tue, 17 May 2022 09:15:19 +0530 Subject: [PATCH 3/8] adding tab navigation for both java/protocol versions --- java_7/README.md | 3 +++ java_8/README.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/java_7/README.md b/java_7/README.md index c8321a1..cfdda4b 100644 --- a/java_7/README.md +++ b/java_7/README.md @@ -1,3 +1,6 @@ +| Using Java 7 with MJSONWP protocol | [Using Java 8 with w3c protocol](./java_8/README.md) | +|----------------------------------- | ---------------------------------------------------- | + # java-appium-app-browserstack This repository demonstrates how to run Appium Java tests on BrowserStack App Automate. diff --git a/java_8/README.md b/java_8/README.md index 772c5e5..1fdff32 100644 --- a/java_8/README.md +++ b/java_8/README.md @@ -1,3 +1,6 @@ +| [Using Java 7 with MJSONWP protocol](./java_7/README.md) | Using Java 8 with w3c protocol | +|--------------------------------------------------------- | ------------------------------ | + # java-appium-app-browserstack This repository demonstrates how to run Appium Java tests on BrowserStack App Automate. From 92daf59439e9973e0a24581e919c9c63fcf027c7 Mon Sep 17 00:00:00 2001 From: deepwired Date: Tue, 17 May 2022 09:17:16 +0530 Subject: [PATCH 4/8] typo, missed a . in back links --- java_7/README.md | 2 +- java_8/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/java_7/README.md b/java_7/README.md index cfdda4b..08bcba8 100644 --- a/java_7/README.md +++ b/java_7/README.md @@ -1,4 +1,4 @@ -| Using Java 7 with MJSONWP protocol | [Using Java 8 with w3c protocol](./java_8/README.md) | +| Using Java 7 with MJSONWP protocol | [Using Java 8 with w3c protocol](../java_8/README.md) | |----------------------------------- | ---------------------------------------------------- | # java-appium-app-browserstack diff --git a/java_8/README.md b/java_8/README.md index 1fdff32..3258241 100644 --- a/java_8/README.md +++ b/java_8/README.md @@ -1,4 +1,4 @@ -| [Using Java 7 with MJSONWP protocol](./java_7/README.md) | Using Java 8 with w3c protocol | +| [Using Java 7 with MJSONWP protocol](../java_7/README.md) | Using Java 8 with w3c protocol | |--------------------------------------------------------- | ------------------------------ | # java-appium-app-browserstack From 07080f9ef35329ad65e4ebb1385ff057354f156f Mon Sep 17 00:00:00 2001 From: deepwired Date: Tue, 17 May 2022 09:20:18 +0530 Subject: [PATCH 5/8] linking to repo instead of readme --- README.md | 4 ++-- java_7/README.md | 4 ++-- java_8/README.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2a67f71..a8965f1 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -| [Using Java 7 with MJSONWP protocol](./java_7/README.md) | [Using Java 8 with w3c protocol](./java_8/README.md) | -|--------------------------------------------------------- | ---------------------------------------------------- | \ No newline at end of file +| [Using Java 7 with MJSONWP protocol](./java_7) | [Using Java 8 with w3c protocol](./java_8) | +|----------------------------------------------- | ------------------------------------------ | \ No newline at end of file diff --git a/java_7/README.md b/java_7/README.md index 08bcba8..84f4288 100644 --- a/java_7/README.md +++ b/java_7/README.md @@ -1,5 +1,5 @@ -| Using Java 7 with MJSONWP protocol | [Using Java 8 with w3c protocol](../java_8/README.md) | -|----------------------------------- | ---------------------------------------------------- | +| Using Java 7 with MJSONWP protocol | [Using Java 8 with w3c protocol](../java_8) | +|----------------------------------- | ------------------------------------------- | # java-appium-app-browserstack diff --git a/java_8/README.md b/java_8/README.md index 3258241..a800119 100644 --- a/java_8/README.md +++ b/java_8/README.md @@ -1,5 +1,5 @@ -| [Using Java 7 with MJSONWP protocol](../java_7/README.md) | Using Java 8 with w3c protocol | -|--------------------------------------------------------- | ------------------------------ | +| [Using Java 7 with MJSONWP protocol](../java_7) | Using Java 8 with w3c protocol | +|------------------------------------------------ | ------------------------------ | # java-appium-app-browserstack From b746acae175e89f22bdeea1c7a788ccac59d92af Mon Sep 17 00:00:00 2001 From: deepwired Date: Tue, 17 May 2022 11:25:44 +0530 Subject: [PATCH 6/8] small content updates --- README.md | 4 ++-- java_7/README.md | 6 +++--- java_8/README.md | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a8965f1..ef3660d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -| [Using Java 7 with MJSONWP protocol](./java_7) | [Using Java 8 with w3c protocol](./java_8) | -|----------------------------------------------- | ------------------------------------------ | \ No newline at end of file +| [Using Java 7 client with MJSONWP protocol](./java_7) | [Using Java 8 client with w3c protocol](./java_8) | +|------------------------------------------------------ | ------------------------------------------------- | \ No newline at end of file diff --git a/java_7/README.md b/java_7/README.md index 84f4288..91d90d7 100644 --- a/java_7/README.md +++ b/java_7/README.md @@ -1,5 +1,5 @@ -| Using Java 7 with MJSONWP protocol | [Using Java 8 with w3c protocol](../java_8) | -|----------------------------------- | ------------------------------------------- | +| Using Java 7 client with MJSONWP protocol | [Using Java 8 client with w3c protocol](../java_8) | +|------------------------------------------ | -------------------------------------------------- | # java-appium-app-browserstack @@ -9,7 +9,7 @@ This repository demonstrates how to run Appium Java tests on BrowserStack App Au ### Requirements -1. Java 8+ +1. Java 8+ (JDK) - If Java is not installed, follow these instructions: - For Windows, download latest java version from [here](https://java.com/en/download/) and run the installer executable diff --git a/java_8/README.md b/java_8/README.md index a800119..4afdc79 100644 --- a/java_8/README.md +++ b/java_8/README.md @@ -1,5 +1,5 @@ -| [Using Java 7 with MJSONWP protocol](../java_7) | Using Java 8 with w3c protocol | -|------------------------------------------------ | ------------------------------ | +| [Using Java 7 client with MJSONWP protocol](../java_7) | Using Java 8 client with w3c protocol | +|------------------------------------------------------- | ------------------------------------- | # java-appium-app-browserstack @@ -9,7 +9,7 @@ This repository demonstrates how to run Appium Java tests on BrowserStack App Au ### Requirements -1. Java 8+ +1. Java 8+ (JDK) - If Java is not installed, follow these instructions: - For Windows, download latest java version from [here](https://java.com/en/download/) and run the installer executable From dd073c2f293d236cf756dcaf98eb7f80f00963ca Mon Sep 17 00:00:00 2001 From: deepwired Date: Wed, 25 May 2022 13:24:57 +0530 Subject: [PATCH 7/8] updated ios device/os combo --- java_7/src/test/java/ios/BrowserStackSample.java | 4 ++-- java_7/src/test/java/ios/BrowserStackSampleLocal.java | 4 ++-- java_8/src/test/java/ios/BrowserStackSample.java | 4 ++-- java_8/src/test/java/ios/BrowserStackSampleLocal.java | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/java_7/src/test/java/ios/BrowserStackSample.java b/java_7/src/test/java/ios/BrowserStackSample.java index 6fd9eea..50a107b 100644 --- a/java_7/src/test/java/ios/BrowserStackSample.java +++ b/java_7/src/test/java/ios/BrowserStackSample.java @@ -25,8 +25,8 @@ public static void main(String[] args) throws MalformedURLException, Interrupted caps.setCapability("app", "bs://"); // Specify device and os_version for testing - caps.setCapability("device", "iPhone 11 Pro"); - caps.setCapability("os_version", "13"); + caps.setCapability("device", "iPhone X"); + caps.setCapability("os_version", "11"); // Set other BrowserStack capabilities caps.setCapability("project", "First Java Project"); diff --git a/java_7/src/test/java/ios/BrowserStackSampleLocal.java b/java_7/src/test/java/ios/BrowserStackSampleLocal.java index f278a07..f2961a8 100644 --- a/java_7/src/test/java/ios/BrowserStackSampleLocal.java +++ b/java_7/src/test/java/ios/BrowserStackSampleLocal.java @@ -40,8 +40,8 @@ public static void main(String[] args) throws Exception { capabilities.setCapability("app", "bs://"); // Specify device and os_version for testing - capabilities.setCapability("device", "iPhone 11 Pro"); - capabilities.setCapability("os_version", "13"); + capabilities.setCapability("device", "iPhone X"); + capabilities.setCapability("os_version", "11"); // Set the browserstack.local capability to true capabilities.setCapability("browserstack.local", true); diff --git a/java_8/src/test/java/ios/BrowserStackSample.java b/java_8/src/test/java/ios/BrowserStackSample.java index 3b5f864..39eb1b6 100644 --- a/java_8/src/test/java/ios/BrowserStackSample.java +++ b/java_8/src/test/java/ios/BrowserStackSample.java @@ -35,9 +35,9 @@ public static void main(String[] args) caps.setCapability("app", "bs://"); // Specify device and os_version for testing - caps.setCapability("deviceName", "iPhone 11 Pro"); + caps.setCapability("deviceName", "iPhone X"); caps.setCapability("platformName", "ios"); - caps.setCapability("platformVersion", "13"); + caps.setCapability("platformVersion", "11"); // Initialise the remote Webdriver using BrowserStack remote URL // and desired capabilities defined above diff --git a/java_8/src/test/java/ios/BrowserStackSampleLocal.java b/java_8/src/test/java/ios/BrowserStackSampleLocal.java index 5ebf5a0..bdb3fc3 100644 --- a/java_8/src/test/java/ios/BrowserStackSampleLocal.java +++ b/java_8/src/test/java/ios/BrowserStackSampleLocal.java @@ -59,9 +59,9 @@ public static void main(String[] args) throws Exception { capabilities.setCapability("app", "bs://"); // Specify device and os_version for testing - capabilities.setCapability("deviceName", "iPhone 11 Pro"); + capabilities.setCapability("deviceName", "iPhone X"); capabilities.setCapability("platformName", "ios"); - capabilities.setCapability("platformVersion", "13"); + capabilities.setCapability("platformVersion", "11"); // Initialise the remote Webdriver using BrowserStack remote URL // and desired capabilities defined above From 893203559eff97611283638dad6d0d15cfd1aa76 Mon Sep 17 00:00:00 2001 From: deepwired Date: Thu, 26 May 2022 08:38:11 +0530 Subject: [PATCH 8/8] iPhone 12 + iOS 13 --- java_7/src/test/java/ios/BrowserStackSample.java | 4 ++-- java_7/src/test/java/ios/BrowserStackSampleLocal.java | 4 ++-- java_8/src/test/java/ios/BrowserStackSample.java | 4 ++-- java_8/src/test/java/ios/BrowserStackSampleLocal.java | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/java_7/src/test/java/ios/BrowserStackSample.java b/java_7/src/test/java/ios/BrowserStackSample.java index 50a107b..ce5ab08 100644 --- a/java_7/src/test/java/ios/BrowserStackSample.java +++ b/java_7/src/test/java/ios/BrowserStackSample.java @@ -25,8 +25,8 @@ public static void main(String[] args) throws MalformedURLException, Interrupted caps.setCapability("app", "bs://"); // Specify device and os_version for testing - caps.setCapability("device", "iPhone X"); - caps.setCapability("os_version", "11"); + caps.setCapability("device", "iPhone 12"); + caps.setCapability("os_version", "13"); // Set other BrowserStack capabilities caps.setCapability("project", "First Java Project"); diff --git a/java_7/src/test/java/ios/BrowserStackSampleLocal.java b/java_7/src/test/java/ios/BrowserStackSampleLocal.java index f2961a8..a4af409 100644 --- a/java_7/src/test/java/ios/BrowserStackSampleLocal.java +++ b/java_7/src/test/java/ios/BrowserStackSampleLocal.java @@ -40,8 +40,8 @@ public static void main(String[] args) throws Exception { capabilities.setCapability("app", "bs://"); // Specify device and os_version for testing - capabilities.setCapability("device", "iPhone X"); - capabilities.setCapability("os_version", "11"); + capabilities.setCapability("device", "iPhone 12"); + capabilities.setCapability("os_version", "13"); // Set the browserstack.local capability to true capabilities.setCapability("browserstack.local", true); diff --git a/java_8/src/test/java/ios/BrowserStackSample.java b/java_8/src/test/java/ios/BrowserStackSample.java index 39eb1b6..09d2013 100644 --- a/java_8/src/test/java/ios/BrowserStackSample.java +++ b/java_8/src/test/java/ios/BrowserStackSample.java @@ -35,9 +35,9 @@ public static void main(String[] args) caps.setCapability("app", "bs://"); // Specify device and os_version for testing - caps.setCapability("deviceName", "iPhone X"); + caps.setCapability("deviceName", "iPhone 12"); caps.setCapability("platformName", "ios"); - caps.setCapability("platformVersion", "11"); + caps.setCapability("platformVersion", "13"); // Initialise the remote Webdriver using BrowserStack remote URL // and desired capabilities defined above diff --git a/java_8/src/test/java/ios/BrowserStackSampleLocal.java b/java_8/src/test/java/ios/BrowserStackSampleLocal.java index bdb3fc3..0493d13 100644 --- a/java_8/src/test/java/ios/BrowserStackSampleLocal.java +++ b/java_8/src/test/java/ios/BrowserStackSampleLocal.java @@ -59,9 +59,9 @@ public static void main(String[] args) throws Exception { capabilities.setCapability("app", "bs://"); // Specify device and os_version for testing - capabilities.setCapability("deviceName", "iPhone X"); + capabilities.setCapability("deviceName", "iPhone 12"); capabilities.setCapability("platformName", "ios"); - capabilities.setCapability("platformVersion", "11"); + capabilities.setCapability("platformVersion", "13"); // Initialise the remote Webdriver using BrowserStack remote URL // and desired capabilities defined above