Error running TestNG tests for apk file with different Android versions(8&9) - aws-device-farm

I am trying run a Appium script written in TestNG for a Android Mobile application in device farm.
When I run the test in device farm devices which are running lower version of Android like 6 and 7 run the tests successfully. However the devices runnning OS version 8 and 9 fail.
All the devices fail with the same error
It is impossible to create a new session because 'createSession' which takes HttpClient, InputStream and long was not found or it is not accessible Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z' System info: host: 'ip-172-31-13-65', ip: '172.31.13.65', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-139-generic', java.version: '1.8.0_151' Driver info: driver.version: AndroidDriver
I have attached screenshot as well.
Any help on this would be highly appreciated
Device farm pic
enter image description here1
enter image description hereenter image description here

Related

Original error: Could not find 'aapt.exe'

I am having hte below error when i try to open an app using appium
org.openqa.selenium.SessionNotCreatedException: 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: Could not find 'aapt.exe' in
["C:\Users\nsingh163\Desktop\Naresh Folder\Automation\Mobile
Automation\Downloads\Android-sdk\platform-tools\aapt.exe","C:\Users\nsingh163\Desktop\Naresh Folder\Automation\Mobile
Automation\Downloads\Android-sdk\emulator\aapt.exe","C:\Users\nsingh163\Desktop\Naresh
Folder\Automation\Mobile
Automation\Downloads\Android-sdk\tools\aapt.exe","C:\Users\nsingh163\Desktop\Naresh
Folder\Automation\Mobile
Automation\Downloads\Android-sdk\tools\bin\aapt.exe"]. Do you
have Android Build Tools installed at
'C:\Users\nsingh163\Desktop\Naresh Folder\Automation\Mobile
Automation\Downloads\Android-sdk'? Build info: version: '3.141.59',
revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host:
'USD4FWTN2', ip: '10.88.4.6', os.name: 'Windows 10', os.arch: 'amd64',
os.version: '10.0', java.version: '1.8.0_171' Driver info:
driver.version: AndroidDriver
I have tried installing Android SDK again but still not able to find aapt.exe in hte tools folder
I am quite new to the mobile automation but I encountered this issue and how I managed to fix it...
aapt.exe is actually not in the "tools" folder :), you have to get "build-tools" folder and there you can find it
in cmd or whatever you are using, you can enter this command (bare in mind that the version is just as an example, I think that it has to match platform-tools you installed previously)
sdkmanager "build-tools;28.0.0"
So, once you have the build-tools folder, just go there and copy aapt.exe from there to the "tools" folder
To resolve this issue, below are the steps:
1. Find API level for your phone/ device. Setting -> About device -> Software Info -> Note down Android Version. -> Goto https://en.wikipedia.org/wiki/Android_version_history
from here, find out API Level for your Android Version.
2. Navigate to sdkmanager.bat path in CMD (\sdk-tools-windows-4333796\tools\bin) and use "sdkmanager "build-tools;21.0.0" to download build-tools for API level 21, change it as per your API level.
3. Once done, copy aapt.exe file from build-tools folder to platform-tools folder.
This should resolve the issue.

Seeing "Couldn't statvfs() path: No such file or directory" when running Android emulator on Ubuntu 18.04

When running the emulator from Android Studio 3.3.2 on Ubuntu 18.04.2 I'm getting the dreaded
Emulator: Couldn't statvfs() path: No such file or directory
message in the Event Log. The emulator seems to be running ok.
I've already installed the 32 bit libraries that are required to run Android Studio as per https://developer.android.com/studio/install#linux. My laptop is a Dell XPS 13 9380 with an Intel 915 chipset so the recommendations I found to install nVidia drivers do not apply.
Also tried switching between hardware and software rendering for the emulator, both with the same effect.
This was my video cards driver, Ive updated that for the vendor drivers and works wonderfully

Selenium shows java.net.SocketException: Connection reset

I have searched for the solution but I have not found the solution I always get this error
codigo :
public static void main(String [] args) {
System.setProperty("webdriver.chrome.driver","C:\\Users\\Ofima\\workspace\\OfimaWeb\\chromedriver.exe");
WebDriver driver= new ChromeDriver();
driver.get("http://ofimawebbeta.ofima.com/");
driver.manage().window().maximize();
driver.getTitle();
}
Error :
Starting ChromeDriver (v2.9.248315) on port 41785
ene 19, 2018 9:48:49 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFORMACIÓN: Detected dialect: OSS
Exception in thread "main" org.openqa.selenium.WebDriverException: java.net.SocketException: Connection reset
Build info: version: '3.8.0', revision: '924c4067df', time: '2017-11-30T11:37:19.049Z'
System info: host: 'PCPOF-021', ip: '10.72.4.128', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_151'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:92)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:325)
at OfimaWeb.cartera.main(cartera.java:23)
Caused by: java.net.SocketException: Connection reset
The error does gives us some hint as follows :
org.openqa.selenium.WebDriverException: java.net.SocketException: Connection reset
Which essentially implies that ChromeDriver binary is unable to spawn a new Chrome Browser process.
Your main issue is the version compatibility among the binaries you are using as follows:
You are using ChromeDriver v2.9 (released 2014-01-31)
Release Notes of ChromeDriver v2.9_ clearly mentions the following :
Supports Chrome v31-34
You mentioned of using latest Chrome. I suppose it is chrome=65.x
You are using Selenium Version 3.8.0 (released 2017-11-30T11:37:19.049Z) [as per the error stack trace within your question]
So there is a clear mismatch between requirement for ChromeDriver v2.9 and the Chrome Browser version you are using. Hence ChromeDriver is unable to spawn the new Chrome Browser process.
Solution
Update ChromeDriver to current v2.35 level.
Downgrade Chrome to stable Chrome v64.x levels. (as per ChromeDriver v2.35 release notes)
Upgrade Selenium to current levels Version 3.8.1.
Clean and Re-Build your project through your IDE.
Clear the Browser Cache
Use CCleaner tool to wipe off all the OS chores.
If your Web Browser base version is too old, uninstall the Web Browser through Revo Uninstaller with Moderate Scan and install a recent GA Released version of the Web Browser.
Execute your #Test.
Download ChromeDriver from
http://chromedriver.storage.googleapis.com/index.html?path=2.33/
This ChromeDriver shall work with your version of Google Chrome.

ionic framework can't load local notifications

I am taking Coursera's course for Multiplatform Mobile Devices and it says to call:
ionic plugin add de.appplant.cordova.plugin.local-notification
But I am getting the following error:
Toms-MBP:confusioncordova toddcoulson$ ionic platform add android
Error: Platform android already added.
Toms-MBP:confusioncordova toddcoulson$ ionic plugin add
de.appplant.cordova.plugin.local-notification Installing
"de.appplant.cordova.plugin.local-notification" for android
Installing "cordova-plugin-device" for android
Using this version of Cordova with older version of cordova-android
is being deprecated. Consider upgrading to cordova-android#5.0.0 or
newer.
Failed to install 'cordova-plugin-device':CordovaError: The provided
path
"/Users/toddcoulson/documents/coursera/fullstack/confusioncordova/platforms/android"
is not an Android project.
at new android_parser (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/metadata/android_parser.js:35:15)
at new PlatformApiPoly (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/PlatformApiPoly.js:62:20)
at Object.getPlatformApi (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/platforms.js:70:23)
at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:610:29)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:407:28
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:509:49
at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
Failed to install
'de.appplant.cordova.plugin.local-notification':CordovaError: The
provided path
"/Users/toddcoulson/documents/coursera/fullstack/confusioncordova/platforms/android"
is not an Android project.
at new android_parser (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/metadata/android_parser.js:35:15)
at new PlatformApiPoly (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/PlatformApiPoly.js:62:20)
at Object.getPlatformApi (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/platforms.js:70:23)
at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:610:29)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:407:28
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:509:49
at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
Error: The provided path
"/Users/toddcoulson/documents/coursera/fullstack/confusioncordova/platforms/android"
is not an Android project.
EDIT: I do think this is an issue getting the emulator for android to work. I thought I had things setup, but I never got the emulator working for android. Here is the error when running emulator:
Total time: 2.031 secs
Built the following apk(s):
/Users/toddcoulson/documents/coursera/fullstack/confusioncordova/platforms/android/build/outputs/apk/android-debug.apk
ANDROID_HOME=/Users/toddcoulson/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home
No emulator specified, defaulting to testOne
Waiting for emulator to start...
emulator: Requested console port 5584: Inferring adb port 5585.
Creating filesystem with parameters:
Size: 69206016
Block size: 4096
Blocks per group: 32768
Inodes per group: 4224
Inode size: 256
Journal blocks: 1024
Label:
Blocks: 16896
Block groups: 1
Reserved block group size: 7 Created filesystem with 11/4224 inodes and 1302/16896 blocks emulator: WARNING: Camera name 'webcam0'
is not found in the list of connected cameras. Use '-webcam-list'
emulator option to obtain the list of connected camera names.
Hax is enabled Hax ram_size 0x77300000 HAX is working and emulator
runs in fast virt mode.
emulator: Listening for console connections on port: 5584 emulator:
Serial number of this emulator (for ADB): emulator-5584
[123145554325504]:WARNING:./android/base/files/IniFile.cpp:158:Failed
to process .ini file
/Users/toddcoulson/.android/emu-update-last-check.ini for reading.
Unknown hax vcpu return 1
Another EDIT:
I was able to get the plug-in to load once I had the android project setup with ionic and got Android Studio to load in an emulator. The emulator is still giving an error I put in the comments, but it did allow me to get past these errors.

Getting "iDeviceInstaller" error even when ideviceinstaller is installed on my mac

I am using mac OSX El Capitan. I have installed eclipse Neon in it. I have a full setup of running selenium scripts using appium on real ios device. For this i have "ideviceinstaller" also installed. I created a project in a workspace to launch an app on the device and it is working fine. But when i copied the same code to different project, it starts giving me the error
org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Could not initialize ideviceinstaller; make sure it is installed and works on your system) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 33.97 seconds
Build info: version: '2.52.0', revision: '4c2593c', time: '2016-02-11 19:06:42'
System info: host: 'MacBookBL9138C.local', ip: '10.104.150.28', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_73'.
I tried by uninstalling the current eclipse and installing eclipse lunar, but its still failing. I tried running same code in new workspace, but still same error.
Any help will be appreciated.
I think i have found the answer for this one. I missed to configure the path in eclipse.
For refer the below link for answer:
https://discuss.appium.io/t/error-could-not-initialize-ideviceinstaller-make-sure-it-is-installed-and-works-on-your-system/11699/5?u=tuhuynh