Page Object - cannot use same page for iOS and Android

Hi, my iOS test is running correctly, but when I try to start test for Android:

java.lang.IllegalArgumentException: Can not set io.appium.java_client.ios.IOSElement field pageObject.HomeScreenPage_new.MyFiles to io.appium.java_client.android.AndroidElement$$EnhancerByCGLIB$$97bbf586
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
at sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:81)
at java.lang.reflect.Field.set(Field.java:764)
at org.openqa.selenium.support.PageFactory.proxyFields(PageFactory.java:116)
at org.openqa.selenium.support.PageFactory.initElements(PageFactory.java:104)
at pageObject.AbstractPage_new.loadPage(AbstractPage_new.java:43)
at pageObject.HomeScreenPage_new.(HomeScreenPage_new.java:66)
at sanityTests.AndroidSanityNAS_testowy.setUp(AndroidSanityNAS_testowy.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

my test class:

public class AndroidSanityNAS_testowy {

public AppiumDriver driver;

public HomeScreenPage_new homeScreenPage;
private MyFiles_new myFiles;

@Before
public void setUp() throws IOException {
driver = DeviceDriver.getInstance().getDriver();

}
@Test
public void test() throws InterruptedException {

  // ----------------- MY FILES ---------------------------
  homeScreenPage = new HomeScreenPage_new(driver);
  //myFiles = homeScreenPage.openAndroidMyFilesPage();

}

@After
public void tearDown() throws Exception {
if (null != driver) {
driver.quit();
}
}

}

Home Screen page:

public class HomeScreenPage_new extends AbstractPage_new {

@AndroidFindBy(xpath = “//android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.support.v4.widget.DrawerLayout[1]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.ScrollView[1]/android.widget.GridLayout[1]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]”)
public WebElement A_MyFiles;
@iOSFindBy(name = “My Files”)
public IOSElement MyFiles;

public HomeScreenPage_new(AppiumDriver driver) {
super(driver);
loadPage();
}

public MyFiles_new openMyFilesPage(){
waitForElement(MyFiles);
MyFiles.click();
return new MyFiles_new(driver);
}

public MyFiles_new openAndroidMyFilesPage(){
waitForElement(A_MyFiles);
A_MyFiles.click();
return new MyFiles_new(driver);
}

Page Base:

public abstract class AbstractPage_new {
public AppiumDriver driver;

public AbstractPage_new(AppiumDriver driver) {
this.driver = DeviceDriver.getInstance().getDriver();
}

public void loadPage(){
PageFactory.initElements(new AppiumFieldDecorator(driver), this);
}

Thank You for any help :slight_smile:

@jakubkopczyk , you can use same locator in same page, provided your app’s UI is almost identical in IOS and Android. Let me give a code how you can use pageobject pattern for Android and IOS.

@AndroidFindBy(xpath = "//android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.support.v4.widget.DrawerLayout[1]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.ScrollView[1]/android.widget.GridLayout[1]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]")
@iOSFindBy(name = "My Files")
public MobileElement MyFiles;  

// Sample Method
 public void selectFile(){
        myFiles.click();
 }

Thanks,
Priyank Shah

2 Likes

Thank you for your help, but the problem still occurs :disappointed:

Can u please paste your server logs?

info: → POST /wd/hub/session {“desiredCapabilities”:{“appPackage”:null,“appActivity”:“com.internetbox.activities.SplashScreenActivity”,“app”:“/Users/qateam/mobiletests1/InternetBoxAutomation/InternetBoxApplication/InternetBoxAndroidApplication-debug.apk”,“autoLaunch”:true,“automationName”:“Appium”,“browserName”:“”,“platformName”:“Android”,“deviceName”:“f90d44fa”,“platfromVersion”:null,“appiumServerUrl”:“http://127.0.0.1:4723/wd/hub”}}

info: Client User-Agent string: Apache-HttpClient/4.4.1 (Java/1.8.0_45)
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***
info: **** NEW SESSION ***

info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: *************************************
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : platfromVersion, board, appiumServerUrl
info: [debug] No appPackage desired capability or server param. Parsing from apk.
info: [debug] Using local app from desired caps: /Users/qateam/mobiletests1/InternetBoxAutomation/InternetBoxApplication/InternetBoxAndroidApplication-debug.apk

info: [debug] Creating new appium session 7c56ded6-07fe-49be-ade6-9e57f7e3df9d
info: Starting android appium

info: [debug] Getting Java version

info: Java version is: 1.8.0_45

info: [debug] Checking whether adb is present
info: [debug] Using adb from /Applications/android-sdk-macosx/platform-tools/adb
info: [debug] Parsing package and activity from app manifest
info: [debug] Checking whether aapt is present
info: [debug] Using aapt from /Applications/android-sdk-macosx/build-tools/23.0.0-preview/aapt
info: [debug] Extracting package and launch activity from manifest.
info: [debug] executing cmd: /Applications/android-sdk-macosx/build-tools/23.0.0-preview/aapt dump badging /Users/qateam/mobiletests1/InternetBoxAutomation/InternetBoxApplication/InternetBoxAndroidApplication-debug.apk

info: [debug] badging package: com.internetbox.debug

info: [debug] badging act: com.internetbox.activities.SplashScreenActivity
info: [debug] Parsed package and activity are: com.internetbox.debug/com.internetbox.activities.SplashScreenActivity
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Checking whether app is actually present
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices…
info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb devices

info: [debug] 1 device(s) connected
info: Found device f90d44fa
info: [debug] Setting device id to f90d44fa
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)

info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa wait-for-device

info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa shell “echo ‘ready’”

info: [debug] Starting logcat capture

info: [debug] Getting device API level
info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa shell “getprop ro.build.version.sdk”

info: [debug] Device is at API Level 22

info: Device API level is: 22
info: [debug] Extracting strings for language: default
info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa shell “getprop persist.sys.language”

info: [debug] Current device persist.sys.language: pl
info: [debug] java -jar “/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-adb/jars/appium_apk_tools.jar” “stringsFromApk” “/Users/qateam/mobiletests1/InternetBoxAutomation/InternetBoxApplication/InternetBoxAndroidApplication-debug.apk” “/tmp/com.internetbox.debug” pl

info: [debug] Reading strings from converted strings.json
info: [debug] Setting language to default

info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa push “/tmp/com.internetbox.debug/strings.json” /data/local/tmp

info: [debug] Checking whether aapt is present
info: [debug] Using aapt from /Applications/android-sdk-macosx/build-tools/23.0.0-preview/aapt
info: [debug] Retrieving process from manifest.
info: [debug] executing cmd: /Applications/android-sdk-macosx/build-tools/23.0.0-preview/aapt dump xmltree /Users/qateam/mobiletests1/InternetBoxAutomation/InternetBoxApplication/InternetBoxAndroidApplication-debug.apk AndroidManifest.xml

info: [debug] Set app process to: com.internetbox.debug
info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Checking app cert for /Users/qateam/mobiletests1/InternetBoxAutomation/InternetBoxApplication/InternetBoxAndroidApplication-debug.apk.
info: [debug] executing cmd: java -jar /Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-adb/jars/verify.jar /Users/qateam/mobiletests1/InternetBoxAutomation/InternetBoxApplication/InternetBoxAndroidApplication-debug.apk

info: [debug] App already signed.

info: [debug] Zip-aligning /Users/qateam/mobiletests1/InternetBoxAutomation/InternetBoxApplication/InternetBoxAndroidApplication-debug.apk
info: [debug] Checking whether zipalign is present
info: [debug] Using zipalign from /Applications/android-sdk-macosx/build-tools/23.0.0-preview/zipalign
info: [debug] Zip-aligning apk.
info: [debug] executing cmd: /Applications/android-sdk-macosx/build-tools/23.0.0-preview/zipalign -f 4 /Users/qateam/mobiletests1/InternetBoxAutomation/InternetBoxApplication/InternetBoxAndroidApplication-debug.apk /var/folders/xc/fykly4rn7hdcs_2kcvn5nb3m0000gn/T/116230-1714-q5xtcp/appium.tmp

info: [debug] MD5 for app is 74c0cff8d3cc7faec3d95cacda6b8cc9

info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa shell “ls /data/local/tmp/74c0cff8d3cc7faec3d95cacda6b8cc9.apk”

info: [debug] Getting install status for com.internetbox.debug

info: [debug] Getting device API level
info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa shell “getprop ro.build.version.sdk”

info: [debug] Device is at API Level 22

info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa shell “pm list packages -3 com.internetbox.debug”

info: [debug] App is not installed
info: Installing App

info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa shell “mkdir -p /data/local/tmp/”

info: [debug] Removing any old apks

info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa shell “ls /data/local/tmp/*.apk”

info: [debug] Found an apk we want to keep at /data/local/tmp/74c0cff8d3cc7faec3d95cacda6b8cc9.apk
info: [debug] Couldn’t find any apks to remove
info: [debug] Uninstalling com.internetbox.debug

info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa shell “am force-stop com.internetbox.debug”

info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa uninstall com.internetbox.debug

info: [debug] App was not uninstalled, maybe it wasn’t on device?

info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa shell “pm install -r /data/local/tmp/74c0cff8d3cc7faec3d95cacda6b8cc9.apk”

info: [debug] Forwarding system:4724 to device:4724
info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa forward tcp:4724 tcp:4724

info: [debug] Pushing appium bootstrap to device…

info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa push “/Applications/Appium.app/Contents/Resources/node_modules/appium/build/android_bootstrap/AppiumBootstrap.jar” /data/local/tmp/

info: [debug] Pushing settings apk to device…
info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa install “/Applications/Appium.app/Contents/Resources/node_modules/appium/build/settings_apk/settings_apk-debug.apk”

info: [debug] Pushing unlock helper app to device…
info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa install “/Applications/Appium.app/Contents/Resources/node_modules/appium/build/unlock_apk/unlock_apk-debug.apk”

info: Starting App

info: [debug] Attempting to kill all ‘uiautomator’ processes
info: [debug] Getting all processes with ‘uiautomator’
info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa shell “ps ‘uiautomator’”

info: [debug] No matching processes found
info: [debug] Running bootstrap
info: [debug] spawning: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.internetbox.debug -e disableAndroidWatchers false

info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1

info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1

info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724

info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
info: [debug] [BOOTSTRAP] [debug] Loading json…
info: [debug] [BOOTSTRAP] [debug] json loading complete.
info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
info: [debug] Waking up device if it’s not alive
info: [debug] Pushing command to appium work queue: [“wake”,{}]
info: [debug] [BOOTSTRAP] [debug] Client connected
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“wake”,“params”:{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: wake
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:true}
info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa shell “dumpsys window”

info: [debug] Screen already unlocked, continuing.
info: [debug] Pushing command to appium work queue: [“getDataDir”,{}]

info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“getDataDir”,“params”:{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:“/data/local/tmp”}
info: [debug] dataDir set to: /data/local/tmp
info: [debug] Pushing command to appium work queue: [“compressedLayoutHierarchy”,{“compressLayout”:false}]

info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“compressedLayoutHierarchy”,“params”:{“compressLayout”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
info: [debug] Getting device API level
info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa shell “getprop ro.build.version.sdk”
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:false}

info: [debug] Device is at API Level 22

info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa shell “am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.internetbox.debug/com.internetbox.activities.SplashScreenActivity”

info: [debug] Waiting for pkg “com.internetbox.debug” and activity “com.internetbox.activities.SplashScreenActivity” to be focused
info: [debug] Getting focused package and activity
info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa shell “dumpsys window windows”

info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa shell “getprop ro.build.version.release”

info: [debug] Device is at release version 5.1.1
info: [debug] Device launched! Ready for commands
info: [debug] Setting command timeout to the default of 7200 secs
info: [debug] Appium session started with sessionId 7c56ded6-07fe-49be-ade6-9e57f7e3df9d
info: ← POST /wd/hub/session 303 45069.750 ms - 74

info: → GET /wd/hub/session/7c56ded6-07fe-49be-ade6-9e57f7e3df9d {}
info: [debug] Responding to client with success: {“status”:0,“value”:{“platform”:“LINUX”,“browserName”:“”,“platformVersion”:“5.1.1”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“appPackage”:null,“appActivity”:“com.internetbox.activities.SplashScreenActivity”,“app”:“/Users/qateam/mobiletests1/InternetBoxAutomation/InternetBoxApplication/InternetBoxAndroidApplication-debug.apk”,“autoLaunch”:true,“automationName”:“Appium”,“browserName”:“”,“platformName”:“Android”,“deviceName”:“f90d44fa”,“platfromVersion”:null,“appiumServerUrl”:“http://127.0.0.1:4723/wd/hub"},“appPackage”:null,“appActivity”:“com.internetbox.activities.SplashScreenActivity”,“app”:“/Users/qateam/mobiletests1/InternetBoxAutomation/InternetBoxApplication/InternetBoxAndroidApplication-debug.apk”,“autoLaunch”:true,“automationName”:“Appium”,“platformName”:“Android”,“deviceName”:“f90d44fa”,“platfromVersion”:null,“appiumServerUrl”:“http://127.0.0.1:4723/wd/hub”},“sessionId”:"7c56ded6-07fe-49be-ade6-9e57f7e3df9d”}

info: ← GET /wd/hub/session/7c56ded6-07fe-49be-ade6-9e57f7e3df9d 200 11.563 ms - 1129 {“status”:0,“value”:{“platform”:“LINUX”,“browserName”:“”,“platformVersion”:“5.1.1”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“appPackage”:null,“appActivity”:“com.internetbox.activities.SplashScreenActivity”,“app”:“/Users/qateam/mobiletests1/InternetBoxAutomation/InternetBoxApplication/InternetBoxAndroidApplication-debug.apk”,“autoLaunch”:true,“automationName”:“Appium”,“browserName”:“”,“platformName”:“Android”,“deviceName”:“f90d44fa”,“platfromVersion”:null,“appiumServerUrl”:“http://127.0.0.1:4723/wd/hub"},“appPackage”:null,“appActivity”:“com.internetbox.activities.SplashScreenActivity”,“app”:“/Users/qateam/mobiletests1/InternetBoxAutomation/InternetBoxApplication/InternetBoxAndroidApplication-debug.apk”,“autoLaunch”:true,“automationName”:“Appium”,“platformName”:“Android”,“deviceName”:“f90d44fa”,“platfromVersion”:null,“appiumServerUrl”:“http://127.0.0.1:4723/wd/hub”},“sessionId”:"7c56ded6-07fe-49be-ade6-9e57f7e3df9d”}

info: → DELETE /wd/hub/session/7c56ded6-07fe-49be-ade6-9e57f7e3df9d {}
info: Shutting down appium session
info: [debug] Pressing the HOME button
info: [debug] executing cmd: /Applications/android-sdk-macosx/platform-tools/adb -s f90d44fa shell “input keyevent 3”

info: [debug] Stopping logcat capture

info: [debug] Logcat terminated with code null, signal SIGTERM
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“shutdown”}
info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:“OK, shutting down”}
info: [debug] [BOOTSTRAP] [debug] Closed client connection
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.
info: [debug] [UIAUTOMATOR STDOUT] Time: 2.786
info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
info: [debug] Sent shutdown command, waiting for UiAutomator to stop…

info: [debug] UiAutomator shut down normally
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
info: [debug] Responding to client with success: {“status”:0,“value”:null,“sessionId”:“7c56ded6-07fe-49be-ade6-9e57f7e3df9d”}
info: ← DELETE /wd/hub/session/7c56ded6-07fe-49be-ade6-9e57f7e3df9d 200 571.628 ms - 76 {“status”:0,“value”:null,“sessionId”:“7c56ded6-07fe-49be-ade6-9e57f7e3df9d”}

I think I solved the problem. I’ve changed all IOSElement to MobileElement and no errors appeared :smile: