Giter VIP home page Giter VIP logo

junit-appium-app-browserstack's Introduction

junit-appium-app-browserstack

This repository demonstrates how to run Appium tests in JUnit4 and Junit5 on BrowserStack App Automate.

BrowserStack Logo

Based on

These code samples are currently based on:

  • Appium-Java-Client: 8.1.1
  • Protocol: W3C

Setup

Requirements

  1. Java 8+

    • If Java is not installed, follow these instructions:
      • For Windows, download latest java version from here 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
  2. Maven

    • If Maven is not downloaded, download it from here
    • For installation, follow the instructions here

Install the dependencies

To install the dependencies for JUnit4 tests, run :

  • For Android

    cd junit-4/android
    mvn clean
  • For iOS

    cd junit-4/ios
    mvn clean

Or,

To install the dependencies for JUnit5 tests, run :

  • For Android

    cd junit-5/android
    mvn clean
  • For iOS

    cd junit-5/ios
    mvn clean

Getting Started

Getting Started with Appium tests in Junit4 and Junit5 on BrowserStack couldn't be easier!

Run first test :

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

Note: If you are facing any issues, refer Getting Help section

Integration with other Java frameworks

For other Java frameworks samples, refer to following repositories :

Note: For other test frameworks supported by App-Automate refer our Developer documentation

Getting Help

If you are running into any issues or have any queries, please check Browserstack Support page or get in touch with us.

junit-appium-app-browserstack's People

Contributors

agundawar avatar avinash-bharti avatar bstack-security-github avatar darshilgada24 avatar deepwired avatar francisf avatar kamal-kaur04 avatar khrithik96 avatar kn-neeraj avatar mukulgupta1 avatar nidhimj22 avatar nitish-bhardwaj-code avatar raghuhit avatar raju249 avatar sinstein avatar tejasshah93 avatar tr4n2uil avatar vedharish avatar yashdsaraf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

junit-appium-app-browserstack's Issues

Problem with Browserstack Dependencies.

Hi.

I`m utilizing Appium + JUnit + Maven + Java.

I have problems with dependencies for Browserstack.

When i utilize this command line, my tests Failed on Jenkins:

<plugins>
  <plugin>
    <groupId>com.browserstack</groupId>
    <artifactId>automate-maven-plugin</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <configuration>
        <source>${jdk.source.version}</source>
        <target>${jdk.target.version}</target>
        <complianceLevel>${jdk.source.version}</complianceLevel>
    </configuration>
    <executions>
      <execution>
        <goals>
          <goal>test-compile</goal>
        </goals>
      </execution>
    </executions>
  </plugin>
</plugins>

This is my error on JENKINS:

--- AspectJ Properties ---
AspectJ Compiler 1.8.7 built on Wednesday Sep 9, 2015 at 21:19:30 GMT
---- Dump Properties ---
Dump file: ajcore.20190820.143242.876.txt
Dump reason: org.aspectj.apache.bcel.classfile.ClassFormatException
Dump on exception: true
Dump at exit condition: abort
---- Exception Information ---
org.aspectj.apache.bcel.classfile.ClassFormatException: File: '/Users/hebertsoares/Documents/Git/ifood-consumer-automation/target/test-classes/META-INF/versions/9/module-info.class': Invalid byte tag in constant pool: 19
at org.aspectj.apache.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:192)
at
org.aspectj.apache.bcel.classfile.ClassParser.parse(ClassParser.java:131)

When i delete this command, my tests run well:

      <execution>
        <goals>
          <goal>test-compile</goal>
        </goals>
      </execution>
    </executions>

Can you help me, please?

My POM File:

<repositories>
    <repository>
        <id>sonatype-nexus-snapshots</id>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
</repositories>

<pluginRepositories>
    <pluginRepository>
        <id>sonatype-nexus-snapshots</id>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </pluginRepository>
</pluginRepositories>

<dependencies>
    <!-- log4j -->
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${slf4j.version}</version>
    </dependency>
    <!-- Allure Report -->

    <!-- Cucumber Dependencies -->
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>${cucumber-junit.version}</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>${cucumber-java.version}</version>
    </dependency>
    <dependency>
        <groupId>net.masterthought</groupId>
        <artifactId>cucumber-reporting</artifactId>
        <version>${cucumber-reporting.version}</version>
    </dependency>
    <!-- jUnit -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit}</version>
    </dependency>
    <!-- Appium -->
    <dependency>
        <groupId>io.appium</groupId>
        <artifactId>java-client</artifactId>
        <version>${appium.version}</version>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-java</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>com.ibm.icu</groupId>
        <artifactId>icu4j</artifactId>
        <scope>provided</scope>
        <version>3.4.4</version>
    </dependency>

    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjrt</artifactId>
        <version>1.8.7</version>
    </dependency>

    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjweaver</artifactId>
        <version>1.8.7</version>
    </dependency>
    <dependency>
        <groupId>com.browserstack</groupId>
        <artifactId>browserstack-local-java</artifactId>
        <version>1.0.0</version>
    </dependency>
    <dependency>
        <groupId>com.browserstack</groupId>
        <artifactId>automate-testassist</artifactId>
        <version>1.0.0</version>
    </dependency>
</dependencies>


<!-- Build  -->

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>

        <!--Plugins to pack the app for AWS-->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>${maven-jar-plugin.version}</version>
            <executions>
                <execution>
                    <goals>
                        <goal>test-jar</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>${maven-dependency-plugin.version}</version>
            <executions>
                <execution>
                    <id>copy-dependencies</id>
                    <phase>package</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                    <configuration>
                        <outputDirectory>${project.build.directory}/dependency-jars/</outputDirectory>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <version>${maven-assembly-plugin.version}</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                    <configuration>
                        <finalName>zip-with-dependencies</finalName>
                        <appendAssemblyId>false</appendAssemblyId>
                        <descriptors>
                            <descriptor>src/main/assembly/zip.xml</descriptor>
                        </descriptors>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>com.browserstack</groupId>
            <artifactId>automate-maven-plugin</artifactId>
            <version>1.0.0-SNAPSHOT</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
                <complianceLevel>1.8</complianceLevel>
            </configuration>
        </plugin>
    </plugins>
</build>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.