question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS/Android driver compatibility issue on a cross-platform testing

See original GitHub issue

Description

I’m using java-client 2.10 in my appium test framework, it’s working good on my environment both for ios and android native application testing, I can reuse almost all the basic method like below:

public static AppiumDriver driver;

public static void setUp() { if (PLATFORM_NAME.equals("ios")){ driver = new IOSDriver(new URL(DRIVER_AGENT),capabilities); } if (PLATFORM_NAME.equals("android")){ driver = new AndroidDriver(new URL(DRIVER_AGENT),capabilities); } }

Then I can create some common method likes ‘click a object name’ for both ios and android

public static void clickObjectByName(final String ObjectName) { driver.findElementByName(ObjectName).click(); }

However, the driver is not working when I upgraded Java-client to 3.4.0 it request to create separately ‘AndDriver’ and ‘iOSDRIVER’ instance, it means that the common methods which I setup in above example could not be reuse again, and I need to setup 2 different test framework for ios and android.

So I think current Java-Client is not friendly for the cross-platform compatibility. can we make some updates?

And I found several people have the same query, here is the link: https://discuss.appium.io/t/ios-android-driver-casting-on-a-shared-test-code-base/1095

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:18 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
rompiccommented, Jun 12, 2016
    if(driver instanceof AndroidDriver) {
        ((AndroidDriver) driver).toggleLocationServices();
    }

seems to do the trick

0reactions
sbjymccommented, Jun 15, 2016

Got it, thanks @rompic

Read more comments on GitHub >

github_iconTop Results From Across the Web

Device compatibility overview - Android Developers
As an app developer, you don't need to worry about whether a device is Android compatible, because only devices that are Android compatible...
Read more >
How to approach Cross Platform Testing | BrowserStack
Cross Platform Compatibility means that the mobile application should function uniformly irrespective of the OS platform and version. With the ...
Read more >
Cross platform testing example for Android and iOS using ...
Appium is “cross-platform”: it allows you to write tests against multiple platforms (iOS, Android), using the same API.
Read more >
Supported Platforms - Appium
Appium supports a variety of platforms and testing modalities (native, hybrid, web, real devices, simulators, etc...). This document is designed to make ...
Read more >
25 Awesome Mobile Testing Tools and Platforms for Android ...
The same API can be used for cross-platform app testing, and you don't have to worry about modifying the app source code as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found