I had a problem with Appium and couldn't fix it - testing

''' An unknown server-side error occurred while processing the
command. Original error: Error executing adbExec. Original error:
'Command 'D:\program\android-sdk\platform-tools\adb.exe -P 5037 -s
f8cb3e08 install -g
E:\appium\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk'
exited with code 1'; Stderr: 'adb: failed to install
E:\appium\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk:
Security exception: You need the
android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS permission to use
the PackageManager.INSTALL_GRANT_RUNTIME_PERMISSIONS flag
java.lang.SecurityException: You need the
android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS permission to use
the PackageManager.INSTALL_GRANT_RUNTIME_PERMISSIONS flag at
com.android.server.pm.PackageInstallerService.createSessionInternal(PackageInstallerService.java:596)
at
com.android.server.pm.PackageInstallerService.createSession(Package';
Code: '1' '''
I've turned on administrator mode
Usb debugging is also enabled
And other environments are already configured
This is my parameter
{
"platformName": "Android",
"platformVersion": "7.0",
"deviceName": "f8cb3e08",
"appPackage": "com.tencent.qqlive",
"appActivity": "ona.activity.SplashHomeActivity",
"noReset": "true",
"autoGrantPermissions": "true"
}

Use automation name as capability.
"automationName":"UiAutomator2"
You can use appium instead UiAutomator2 as default.

Related

Android emulator tear down during tests run

guys!
I run my Android tests with Appium on Android emulator. Where I run my tests in sequence emulator sometimes tear down and remaining tests are ignored.
In Appium logs i see this error:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: 'Command 'C:\\Users\\Username\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe -P 5037 -s emulator-5554 shell settings delete global hidden_api_policy_pre_p_apps' exited with code 20'; Stderr: 'cmd: Can't find service: settings'; Code: '20'
Is there anybody face with such problem?
You are trying to run an adb-shell command which is not allowed.
Appium has some in-secure commands that normally it will not allow them to be used.
You can see the commands here: Appium Insecure Features
The adb-shell commands (to change the system settings) is one of them.
Follow the link to how to prevent appium checking this.
How to resolve:
At the beginning of test setup, run this commnad: appium --relaxed-security with command line. Then the appium let you using the insecure feautures during the test.
for example in pyhton you should run os.system(appium --relaxed-security (while having appium directory in the system environment variables path.

Failure to build arch package - aborting

I'm trying to build a package for ArchLinux with the following command:
extra-x86_64-build -cr archbuild
It fails with the following error:
Dropping capabilities failed: Operation not permitted
Child died too early.
==> ERROR: Aborting...
I have no idea why is it failing.
Update: Running as root or a normal user makes no difference, both return the same error.

How to fix invoke uiautomator from command Prompt

I want to run uiautomatorviewer from command Prompt.
But it gives an error:
-Djava.ext.dirs=..\lib\x86_64;..\lib is not supported. Use
-classpath instead.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Please guide.
Download JDK 8 version & install it
Set Environment variable as [JAVA_HOME : C:\Program Files\Java\jdk1.8.0_65]
Path = %JAVA_HOME%\bin & %JAVA_HOME%\lib
and provide uiautomatorviewer.bat command in cmd
The above scenario will work.

Jenkins throws error instantiating firefox, works fine with Maven

1515175026602 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Windows\\TEMP\\rust_mozprofile.MX9tmRHWAJFL"
1515175027227 Marionette INFO Enabled via --marionette
###!!! [Parent][MessageChannel] Error: (msgtype=0x240057,name=PContent::Msg_SetPluginList) Channel error: cannot send/recv
###!!! [Parent][MessageChannel] Error: (msgtype=0x24004C,name=PContent::Msg_GMPsChanged) Channel error: cannot send/recv
###!!! [Parent][MessageChannel] Error: (msgtype=0x15008F,name=PBrowser::Msg_UpdateNativeWindowHandle) Channel error: cannot send/recv
###!!! [Parent][MessageChannel] Error: (msgtype=0x150083,name=PBrowser::Msg_Destroy) Channel error: cannot send/recv
A content process crashed and MOZ_CRASHREPORTER_SHUTDOWN is set, shutting down
The issue got fixed by installing Jenkins using jenkins.war in the command prompt. Earlier I have installed using .exe file as like usual windows softwares.
.exe instals it as a windows service and .war as a java executable
Run "java -jar jenkins.war" on cmd, configure and run the build, would resolve the problem
this issue may be with unsupported security preferences set up in code, I faced this issue in mac while I was setting up this preference in FF v62. and gecko 0.24
profile.setPreference("security.sandbox.content.level", 5);

How to I pass GIT's username and password to gradle plugin?

I'm trying to release using the gradle release plugin but whenever the plugin is using GIT, it's not passing my username and password:
I 'm invoking it as:
I'm using:
C:\GradleReleaseTest>gradle --version
------------------------------------------------------------
Gradle 2.11
------------------------------------------------------------
Build time: 2016-02-08 07:59:16 UTC
Build number: none
Revision: 584db1c7c90bdd1de1d1c4c51271c665bfcba978
Groovy: 2.4.4
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM: 1.8.0_66 (Oracle Corporation 25.66-b18)
OS: Windows 7 6.1 amd64
My gradle release configuration looks as:
release {
failOnCommitNeeded = true
failOnPublishNeeded = true
failOnSnapshotDependencies = true
failOnUnversionedFiles = true
failOnUpdateNeeded = true
revertOnFail = true
preCommitText = ''
preTagCommitMessage = '[Gradle Release Plugin] ${release.releaseVersion} - pre tag commit: '
tagCommitMessage = '[Gradle Release Plugin] ${release.releaseVersion} - creating tag : '
newVersionCommitMessage = '[Gradle Release Plugin] ${release.releaseVersion} - new version commit: '
tagTemplate = '${version}'
// May decide to add additional custom tasks here
buildTasks = ['build']
scmAdapters = [
net.researchgate.release.GitAdapter
]
}
The error I'm getting looks like:
C:\GradleReleaseTest>gradle release -Prelease.releaseVersion=1
.0.0 -Prelease.newVersion=1.0.1-SNAPSHOT -Prelease.username=jvergara -Prelease.p
assword=thePassword
:release
:com.mycompany.gradletest:createScmAdapter
:com.mycompany.gradletest:initScmAdapter
:com.mycompany.gradletest:checkCommitNeeded
:com.mycompany.gradletest:checkUpdateNeeded
Running [git, remote, update] produced an error: [bash: /dev/tty: No such device
or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.mycompany.com': Invalid ar
gument
error: Could not fetch origin]
:com.mycompany.gradletest:checkUpdateNeeded FAILED
:release FAILED
Release process failed, reverting back any changes made by Release Plugin.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':checkUpdateNeeded'.
> Failed to run [git remote update] - [Fetching origin
][bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://git.mycompany.com': Invalid ar
gument
error: Could not fetch origin
]
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
BUILD FAILED
Total time: 5.912 secs
I managed to resolve this. The problem has nothing to do with the plugin at all, but rather how git itself work.
You either have to use a global config for the credentials or you have to use local config
See, https://git-scm.com/docs/gitcredentials. I used the local version and it works just fine.