Appium Espresso backdoor - android

I use Espresso to call the method
AndroidDriver androidDriver = this.powerWebDriver().getAndroidWebDriver();
"androidDriver.executeScript("mobile: backdoor", scriptArgss);"
and I got this error:
org.openqa.selenium.UnsupportedCommandException: Unknown mobile command "backdoor". Only shell,scrollBackTo,viewportScreenshot,deepLink,startLogsBroadcast,stopLogsBroadcast,acceptAlert,dismissAlert,batteryInfo,deviceInfo,changePermissions,getPermissions,performEditorAction commands are supported.
Any idea what I am doing wrong?

Related

lint unit tests not running: java.lang.NoSuchFieldError: USE_PSI_CLASS_FILES_READING

I've wrote a lint rule to be used in my Android Studio project. It is already working successfully. However, the tests are not running. Everytime I try to execute the tests, I receive the following error:
USE_PSI_CLASS_FILES_READING
java.lang.NoSuchFieldError: USE_PSI_CLASS_FILES_READING
at com.android.tools.lint.UastEnvironmentKt.createKotlinCompilerConfig(UastEnvironment.kt:310)
at com.android.tools.lint.UastEnvironmentKt.access$createKotlinCompilerConfig(UastEnvironment.kt:1)
at com.android.tools.lint.UastEnvironment$Configuration$Companion.create(UastEnvironment.kt:118)
at com.android.tools.lint.LintCliClient.initializeProjects(LintCliClient.kt:1349)
at com.android.tools.lint.client.api.LintClient.performInitializeProjects$lint_api(LintClient.kt:1012)
at com.android.tools.lint.client.api.LintDriver.initializeProjectRoots(LintDriver.kt:570)
at com.android.tools.lint.client.api.LintDriver.doAnalyze(LintDriver.kt:485)
at com.android.tools.lint.client.api.LintDriver.doAnalyze$default(LintDriver.kt:474)
at com.android.tools.lint.client.api.LintDriver.analyze(LintDriver.kt:418)
at com.android.tools.lint.checks.infrastructure.TestLintClient.analyze(TestLintClient.java:671)
at com.android.tools.lint.checks.infrastructure.TestLintClient.analyze(TestLintClient.java:602)
at com.android.tools.lint.checks.infrastructure.TestLintClient.checkLint(TestLintClient.java:349)
at com.android.tools.lint.checks.infrastructure.TestLintRunner.checkLint(TestLintRunner.kt:229)
at com.android.tools.lint.checks.infrastructure.TestLintRunner.run(TestLintRunner.kt:172)
at com.android.tools.lint.checks.infrastructure.TestLintTask.run(TestLintTask.java:933)
Basically, the error occurs everytime I call the run method of lint() in my tests:
lint().files(classFile)
.allowMissingSdk()
.run()
.expectWarningCount(1)
I executed the tests from Android Studio and by using ./gradlew lint-rules:test. In both cases the same error arises.
Thanks for your help!

Appium Calculator Program issue

I am running Appium calculator first program but I am facing this error.
I have taken help from this YouTube link to just copy and run it by myself
https://www.youtube.com/watch?v=N7vY3cPSo8g&list=PLhW3qG5bs-L8npSSZD6aWdYFQ96OEduhk&index=7
java.lang.reflect.InvocationTargetException
Unable to create a new remote session. Please check the server log for more details. Original error: An unknown server-side error occurred while processing the command. Original error: 'app' option is required for reinstall
Original error: 'app' option is required for reinstall means that you must specify app capability with an absolute path to your tested app:
DesiredCapabilities capabilities = new DesiredCapabilities();
...
capabilities.setCapability("app", "/path/to/your/application");

Unable to launch WebDriver Agent because of xcodebuild failure

Me using Xcode_8.2.1 . When i am building my app its trowing error implicit converstation from nullable pointer
I suggest to
Get clean WebDriverAgent project from github repo or via appium installation, you can find it on your local machine:
/Users/someName/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
Run ./Scripts/bootstrap.sh for "clean" project in path specified above
Open WebDriverAgent.xcodeproj and check if there are any errors

android.support.v7.widget.RecyclerView: null object reference only when app is opened via appium

Are there any differences between running an app manually and using appium?
Because
It only happens when the app is started by appium. When app is installed and started manually, it runs normally without crashes.
If I want to automatically or manually display the one specific page the app crash “Unfortunately,… has stopped”
There are not any errors about it in appium logs. Only this exception in android monitor:
E/AndroidRuntime: FATAL EXCEPTION: main Process: ..., PID: 26842
java.lang.NullPointerException: Attempt to read from field
'android.support.v7.widget.RecyclerView$Recycler
android.support.v7.widget.RecyclerView.mRecycler' on a null object
reference
at android.support.v7.widget.RecyclerView$LayoutManager.onInitializeAccessibilityNodeInfo(RecyclerView.java:9580)
at android.support.v7.widget.RecyclerViewAccessibilityDelegate.onInitializeAccessibilityNodeInfo(RecyclerViewAccessibilityDelegate.java:59)
at android.support.v4.view.AccessibilityDelegateCompat$AccessibilityDelegateJellyBeanImpl$1.onInitializeAccessibilityNodeInfo(AccessibilityDelegateCompat.java:246)
at android.support.v4.view.AccessibilityDelegateCompatJellyBean$1.onInitializeAccessibilityNodeInfo(AccessibilityDelegateCompatJellyBean.java:66)
at android.view.View.onInitializeAccessibilityNodeInfo(View.java:6076)
at android.view.View.createAccessibilityNodeInfoInternal(View.java:6037)
at android.view.View$AccessibilityDelegate.createAccessibilityNodeInfo(View.java:22281)
at android.view.View.createAccessibilityNodeInfo(View.java:6020)
at android.view.accessibility.AccessibilityRecord.setSource(AccessibilityRecord.java:145)
at android.view.accessibility.AccessibilityRecord.setSource(AccessibilityRecord.java:119)
at android.view.View.onInitializeAccessibilityEventInternal(View.java:5974)
at android.view.View$AccessibilityDelegate.onInitializeAccessibilityEvent(View.java:22193)
at android.support.v4.view.AccessibilityDelegateCompatIcs.onInitializeAccessibilityEvent(AccessibilityDelegateCompatIcs.java:97)
at android.support.v4.view.AccessibilityDelegateCompat$AccessibilityDelegateIcsImpl.onInitializeAccessibilityEvent(AccessibilityDelegateCompat.java:192)
at android.support.v4.view.AccessibilityDelegateCompat.onInitializeAccessibilityEvent(AccessibilityDelegateCompat.java:432)
at android.support.v7.widget.RecyclerViewAccessibilityDelegate.onInitializeAccessibilityEvent(RecyclerViewAccessibilityDelegate.java:65)
at android.support.v4.view.AccessibilityDelegateCompat$AccessibilityDelegateJellyBeanImpl$1.onInitializeAccessibilityEvent(AccessibilityDelegateCompat.java:241)
at android.support.v4.view.AccessibilityDelegateCompatJellyBean$1.onInitializeAccessibilityEvent(AccessibilityDelegateCompatJellyBean.java:61)
at android.view.View.onInitializeAccessibilityEvent(View.java:5960)
at android.view.View.sendAccessibilityEventUncheckedInternal(View.java:5827)
at android.view.View$AccessibilityDelegate.sendAccessibilityEventUnchecked(View.java:22132)
at android.support.v4.view.AccessibilityDelegateCompatIcs.sendAccessibilityEventUnchecked(AccessibilityDelegateCompatIcs.java:122)
at android.support.v4.view.AccessibilityDelegateCompat$AccessibilityDelegateIcsImpl.sendAccessibilityEventUnchecked(AccessibilityDelegateCompat.java:223)
at android.support.v4.view.AccessibilityDelegateCompat.sendAccessibilityEventUnchecked(AccessibilityDelegateCompat.java:371)
at android.support.v4.view.AccessibilityDelegateCompat$AccessibilityDelegateJellyBeanImpl$1.sendAccessibilityEventUnchecked(AccessibilityDelegateCompat.java:268)
at android.support.v4.view.AccessibilityDelegateCompatJellyBean$1.sendAccessibilityEventUnchecked(AccessibilityDelegateCompatJellyBean.java:87)
at android.view.View.sendAccessibilityEventUnchecked(View.java:5810)
at android.support.v7.widget.RecyclerView.sendAccessibilityEventUnchecked(RecyclerView.java:3206)
at android.view.View.sendAccessibilityEventInternal(View.java:5789)
at android.view.View$AccessibilityDelegate.sendAccessibilityEvent(View.java:22090)
at android.support.v4.view.AccessibilityDelegateCompatIcs.sendAccessibilityEvent(AccessibilityDelegateCompatIcs.java:117)
at android.support.v4.view.AccessibilityDelegateCompat$AccessibilityDelegateIcsImpl.sendAccessibilityEvent(AccessibilityDelegateCompat.java:217)
at android.support.v4.view.AccessibilityDelegateCompat.sendAccessibilityEvent(AccessibilityDelegateCompat.java:349)
at android.support.v4.view.AccessibilityDelegateComp
I use appium v1.6.5 (1.7.1) and Android 6.0 - 7.1 emulators
Appium is using adb shell to install/launch app and for elements interactions it use UiAutomator / UiAutomator2 (depends on AutomationName capability you provided)
You can see it in Appium server logs:
install apk:
Running '/Users/<user>/Library/Android/sdk/platform-tools/adb'
with args:["-P",5037,"-s","192.168.56.101:5555","shell","ls",
"/data/local/tmp/f0f1ea15bc776c996fddca878b00c589.apk"]
launch app:
Running '/Users/<user>/Library/Android/sdk/platform-tools/adb'
with args: ["-P",5037,"-s","192.168.56.101:5555","shell","am","start",
"-W","-n","<app_package>/<app_package>.launch.view.LaunchActivity","-S"]
waits for expected activity to be started:
Getting focused package and activity
Running '/Users/dmitry/Library/Android/sdk/platform-tools/adb' with args:
["-P",5037,"-s","192.168.56.101:5555","shell","dumpsys","window","windows"]
Found package: <package> and fully qualified activity name : <activity_name>
finalize session creation:
New AndroidDriver session created successfully,
session 807d2f94-bf31-4107-87ca-848261a4ce15 added to master session list
So you can try the same commands from terminal and see if you can reproduce the crash

Selendroid 0.5.1 on Windows: getting INSTRUMENTATION_FAILED

I am working on a Phonegap/Cordova 3.0 Android (hybrid) app and want to do UI testing. I tried running Appium and Selendroid (http://selendroid.io/) I run on Win 8.1 x64, and am using Visual Studio 2012 with Selenium 2.37 nuget package to write the tests.
The app is loaded OK, along with selendroid in my Android emulator running through eclipse.
I get this error when trying to start up the app through the tool. Any ideas?
android.util.AndroidException: INSTRUMENTATION_FAILED:
com.example.femmapp.selendroid/io.selendroid.ServerInstrumentation
The error message and stack trace is:
A session is either terminated or not started (Original error:
android.util.AndroidException: I
) (NoSuchDriver)AILED:
com.example.femmapp.selendroid/io.selendroid.ServerInstrumentation
at
OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response
errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String
driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities
desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor
commandExecutor, ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(Uri remoteAddress,
ICapabilities desiredCapabilities, TimeSpan commandTimeout)
at FEMM.IntegrationTests.TestDriverSetup.TestDriverSetUp(Int32 minutes,
Int32 seconds, String apppkg, String devname, String devv
ers, String webdrvr, String activity, Boolean saucelabs) in c:\mydir
Have you tried to use selendroid directly?
If you have setup everything, you find a complete sample project of a cordova hybrid app here: https://github.com/selendroid/demoproject-selendroid#hybrid-app-test
In order to get the latest updates, I recommend you to use the latest snapshot version of selendroid: http://ci.selendroid.io/job/selendroid/io.selendroid$selendroid-standalone/
check your capability settings, if your appPackage is wrong?
remove all the apks related to appium, then retry.
remove all the temp files in C:\Users\xxxx\AppData\Local\Temp, then retry.
Hope it helps.

Categories

Resources