appium / appium/java-client

Use in android studio

Open
#175 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.3k
Forks
752
Avg merge
6d 21h
Merged PRs (30d)
8

Description

What I am trying to do is to use it directly as Robolectric unit tests in Android Studio. The problem comes when I create a new AndroidDriver():

new AndroidDriver(new URL("http://0.0.0.0:4723/wd/hub"), capabilities);

The selenium driver uses the apache-http client which in Android is not complete so there are missing classes from the preloaded one. My next step is to use Jarjar to stitch together a new version of http client in the Android SDK jar.

Not sure if it worths the pain, but I would like to discuss if this sounds like a good idea (fake the UI tests as unit tests)?

A different option is of course to create a different project only to test the apk.

Fyi piece from my .gradle:

testApt 'com.squareup.dagger:dagger-compiler:1.2.2'
testCompile 'com.squareup.dagger:dagger:1.2.2'
testCompile ('io.appium:java-client:2.2.0'){
    exclude module: 'guava'
    exclude module: 'httpmime'
    exclude module: 'gson'
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Android Studio/Robolectric setup described in the issue, including the new AndroidDriver URL and the Gradle dependencies. Investigate the incomplete Apache HTTP client classes and the proposed Jarjar approach, then compare that with a separate APK test project. Done would be a decided, reproducible approach or a documented limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.