Android studio: emulator is running but showing "No purchase screen" - testing

enter image description here
documentation on this error, please visit: https://www.seleniumhq.org/exceptions/no_such_element.html
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'prd-20-04-use1c10904074-d073-4f05-8205-cbd45384f44b', ip: '10.0.1.93', os.name: 'Linux', os.arch: 'amd64', os.version: '5.13.0-1015-gcp', java.version: '11.0.15'
Driver info: io.appium.java_client.AppiumDriver
Capabilities {app: /bitrise/deploy/reader-alph..., appActivity: com.nytimes.android.registe..., appPackage: com.nytimes.android, appWaitActivity: com.nytimes.android.registe..., appWaitDuration: 50000, appWaitForLaunch: true, appWaitPackage: com.nytimes.android, automationName: UiAutomator2, databaseEnabled: false, desired: {app: /bitrise/deploy/reader-alph..., appActivity: com.nytimes.android.registe..., appPackage: com.nytimes.android, appWaitActivity: com.nytimes.android.registe..., appWaitDuration: 50000, appWaitForLaunch: true, appWaitPackage: com.nytimes.android, automationName: UiAutomator2, deviceName: Android Emulator, platformName: Android, platformVersion: 10, resetKeyboard: false, unicodeKeyboard: false}, deviceApiLevel: 29, deviceManufacturer: Google, deviceModel: Android SDK built for x86, deviceName: emulator-5554, deviceScreenDensity: 420, deviceScreenSize: 1080x1920, deviceUDID: emulator-5554, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, pixelRatio: 2.625, platform: LINUX, platformName: LINUX, platformVersion: 10, resetKeyboard: false, statBarHeight: 63, takesScreenshot: true, unicodeKeyboard: false, viewportRect: {height: 1731, left: 0, top: 63, width: 1080}, warnings: {}, webStorageEnabled: false}
Session ID: 6f253001-0fb1-437b-be63-710178cbb279
*** Element info: {Using=id, value=SettingsBarButton}

Related

Error creating a session from desired capabilities

When I run my wdio test I get the error:
Unable to create session from Desired Capabilities.
Any recommendation on this?
I have the selenium-server-standalone-3.141.59.jar running. Also I'm running the Appium
wdio version = v4.14.4
The entire Error:
ERROR: Unable to create session from {
"desiredCapabilities": {
"app": "\u002fhome\u002fAD\full_path.apk",
"rotatable": true,
"allowTestPackages": true,
"appiumVersion": "1.13.0",
"handlesAlerts": true,
"deviceName": "ANE-LX2J",
"requestOrigins": {
"url": "http:\u002f\u002fwebdriver.io",
"version": "4.14.4",
"name": "webdriverio"
},
"autoLaunch": true,
"platformVersion": "8.0.0",
"locationContextEnabled": true,
"name": "Test Breadwallet on android real devices",
"automationName": "UiAutomator2",
"browserName": "",
"javascriptEnabled": true,
"maxInstances": 1,
"platformName": "android"
},
"capabilities": {
"firstMatch": [
{
"browserName": "",
"platformName": "android"
}
]
}
}
More info:
Build info: version: 3.141.59
revision: e82be7d358
System info: host: jpdla00159.ad.sbibits.com
ip: 10.128.0.234
os.name: Linux, os.arch: amd64, os.version: 3.10.0-862.14.4.el7.x86_64,
java.version:1.8.0_19
Driver info: driver.version: unknown
Capabilities in wdio.conf.js:
capabilities: {
device: {
protocol: "http",
host: 'localhost',
port: 4444,
desiredCapabilities: {
name: "Android test on my app",
maxInstances: 1,
appiumVersion: "1.13.0",
platformName: "android",
platformVersion: "8.0.0",
automationName: "UiAutomator2",
browserName: "",
deviceName: "ANE-LX2J",
app: "/home/AD/xx/full_path.apk",
autoLaunch: true,
allowTestPackages: true
}
}
},
_

Is selenium automation in Opera browser possible using nightwatchJS?

I'm trying automation in Opera browser, but it's not working.
I got the below error message:
'Unable to create new service: OperaDriverService\nBuild
Here is my nightwatch.json code for opera:
"local-opera": {
"launch_url": "http://localhost",
"selenium_host": "127.0.0.1",
"selenium_port": 4444,
"silent": true,
"output": true,
"screenshots": {
"enabled": false,
"path": ""
},
"skip_testcases_on_fail": false,
"desiredCapabilities": {
"browserName": "opera",
"javascriptEnabled": true,
"acceptSslCerts": true,
"operaOptions": {
"binary": "C:/Users/userName/AppData/Local/Programs/Opera/launcher.exe"
}
}
}
I am able to automate testing of my app in Chrome, Firefox, Edge and IE but I only find a problem with Opera.

Running test with Nightwatch in Firefox fails to connect to Selenium server

I'm trying to do an automated testing for a website using Nightwatch.js and I'm on macOS High Sierra.
So I started testing using the Selenium Standalone Server as said in the documentation.
The chrome testing works good and I have no problem with it. But I can't seem to make the Firefox testing work, I've been testing and searching online for a fix but I gave up because none of the solutions I found worked.
Here's is my nightwatch.json configuration file.
{
"src_folders": [
"test"
],
"output_folder": "reports",
"custom_commands_path": "",
"custom_assertions_path": "",
"page_objects_path": "",
"globals_path": "",
"selenium": {
"start_process": true,
"server_path": "./bin/selenium-server-standalone-3.13.0.jar",
"log_path": "",
"port": 4444,
"cli_args": {
"webdriver.chrome.driver": "./bin/chromedriver",
"webdriver.gecko.driver": "./bin/geckodriver",
"webdriver.firefox.profile": "nightwatch"
}
},
"test_settings": {
"default": {
"launch_url": "https://www.google.com",
"selenium_port": 4444,
"selenium_host": "127.0.0.1",
"default_path_prefix": "",
"silent": true,
"screenshots": {
"enabled": false,
"path": ""
},
"desiredCapabilities": {
"browserName": "firefox",
"javascriptEnabled": true,
"acceptSslCerts": true,
"marionette": true
}
},
"chrome": {
"desiredCapabilities": {
"browserName": "chrome",
"chromeOptions": {
"args": [
"--load-extension=/Users/jackch/Downloads/chrome, --url-base=/wd/hub"
]
}
}
}
}
}
And then when I run nightwatch -e --verbose in the terminal, I get the same error Error retrieving a new session from the selenium server Connection refused! Is selenium server started?.
I tried many things:
1) I started geckodriver in a separate terminal on the default port 4444, and here are the logs from geckodriver:
2018-07-23 12:09:03.432 plugin-container[27769:6329668] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x7903, name = 'com.apple.tsm.portname'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2018-07-23 12:09:03.559 plugin-container[27769:6329668] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x7943, name = 'com.apple.coredrag'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2018-07-23 12:09:03.624 plugin-container[27770:6329696] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x7b37, name = 'com.apple.tsm.portname'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2018-07-23 12:09:03.713 plugin-container[27770:6329696] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x7bcf, name = 'com.apple.coredrag'
See /usr/include/servers/bootstrap_defs.h for the error codes.
1532336943850 Marionette INFO Listening on port 52869
2018-07-23 12:09:04.333 plugin-container[27771:6329828] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x7d07, name = 'com.apple.tsm.portname'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2018-07-23 12:09:04.413 plugin-container[27771:6329828] *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x7d83, name = 'com.apple.coredrag'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2) Then I tried to change the port of geckodriver, because I thought they may intefere since both Selenium and gecko choose the 4444 port, but nothing changed.
3) I tried to launch the Selenium server alone and then linking it. Which mean that I set the "start_process" to false in the nightwatch.json. And I still didn't manage to make it work.
Here is the complete message after I run nightwatch -e --verbose:
Starting selenium server... started - PID: 28112
[Test] Test Suite
=====================
Running: Login
INFO Request: POST /session
- data: {"desiredCapabilities":{"browserName":"firefox","javascriptEnabled":true,"acceptSslCerts":true,"platform":"ANY","marionette":true,"name":"Test"}}
- headers: {"Content-Type":"application/json; charset=utf-8","Content-Length":145}
INFO Response 200 POST /session (1721ms) { value:
{ sessionId: '187e2af1-54a1-224a-9b8d-d4ff9f3913c7',
capabilities:
{ acceptInsecureCerts: false,
browserName: 'firefox',
browserVersion: '61.0.1',
'moz:accessibilityChecks': false,
'moz:headless': false,
'moz:processID': 28131,
'moz:profile': '/var/folders/vw/j4dsztz17sj_vtk500lv09r00000gn/T/rust_mozprofile.GRCHbtKdy2zm',
'moz:useNonSpecCompliantPointerOrigin': false,
'moz:webdriverClick': true,
pageLoadStrategy: 'normal',
platformName: 'darwin',
platformVersion: '17.7.0',
rotatable: false,
timeouts: { implicit: 0, pageLoad: 300000, script: 30000 } } } }
Error retrieving a new session from the selenium server
Connection refused! Is selenium server started?
{ value:
{ sessionId: '187e2af1-54a1-224a-9b8d-d4ff9f3913c7',
capabilities:
{ acceptInsecureCerts: false,
browserName: 'firefox',
browserVersion: '61.0.1',
'moz:accessibilityChecks': false,
'moz:headless': false,
'moz:processID': 28131,
'moz:profile': '/var/folders/vw/j4dsztz17sj_vtk500lv09r00000gn/T/rust_mozprofile.GRCHbtKdy2zm',
'moz:useNonSpecCompliantPointerOrigin': false,
'moz:webdriverClick': true,
pageLoadStrategy: 'normal',
platformName: 'darwin',
platformVersion: '17.7.0',
rotatable: false,
timeouts: [Object] } } }
Thank you for any help you can bring.
I run nightwatch on mac os high sierra on firefox, safari, chrome. And on window opera, IE.
My config:
module.exports = {
"src_folders": ["tests"],
"output_folder": "reports",
// "live_output" : true,
// "parallel_process_delay" : 1500,
"custom_commands_path": "commands",
"custom_assertions_path": "assertions",
"page_objects_path": "",
"globals_path": "",
"selenium": {
"start_process": true,
"server_path": "./node_modules/nightwatch/lib/sel-serv.jar",
"log_path": "selenium_logs",
"port": 4444,
"cli_args": {
"webdriver.chrome.driver": "./node_modules/.bin/chromedriver",
"webdriver.gecko.driver": "./node_modules/.bin/geckodriver",
"webdriver.edge.driver": "./node_modules/.bin/edgedriver",
"webdriver.ie.driver": "drivers/IEDriverServer.exe",
"webdriver.opera.driver": "drivers/operadriver.exe",
"webdriver.safari.driver": "/usr/bin/safaridriver"
}
},
"test_settings": {
"default": {
"selenium_port": 4444,
"selenium_host": "localhost",
"default_path_prefix": "/wd/hub",
"silent": true,
"screenshots": {
"enabled": true,
"on_failure": true,
"on_error": true,
"path": "tmp_screenshots"
}
},
"firefox": {
"desiredCapabilities": {
"browserName": "firefox",
"marionette": true,
"acceptSslCerts": true,
"javascriptEnabled": true
},
"globals": {
"type": "firefox",
"user": "me1",
"pass": "test"
}
},
"chrome": {
"desiredCapabilities": {
"browserName": "chrome",
"chromeOptions": {
"args": [
"disable-web-security",
"use-fake-device-for-media-stream",
"use-fake-ui-for-media-stream"
]
},
"acceptSslCerts": true,
"javascriptEnabled": true
},
"globals": {
"type": "chrome",
"user": "me1",
"pass": "test"
}
},
"opera": {
"desiredCapabilities": {
"browserName": "opera",
"operaOptions": {
"binary": "C://Program Files//Opera//53.0.2907.68//opera.exe"
},
"acceptSslCerts": true,
"javascriptEnabled": true
},
"globals": {
"type": "opera",
"user": "me4",
"pass": "test"
}
},
"ie": {
"desiredCapabilities": {
"browserName": "internet explorer",
"version": 11,
"allowBlockedContent": true,
"javascriptEnabled": true,
"acceptSslCerts": true,
"ignoreProtectedModeSettings": true
},
"globals": {
"type": "ie",
"user": "me3",
"pass": "test"
}
},
"safari": {
"desiredCapabilities": {
"browserName": "safari",
"javascriptEnabled": true,
"acceptSslCerts": true
},
"globals": {
"type": "safari",
"user": "me3",
"pass": "test"
}
}
},
"test_workers": {
"enabled": true,
"workers": "auto"
}
};

webdriverIO and iOS simulator browser testing

I am attempting to run browser testing through the iOS simulator using webdriverIO. But instead of running the browser through the iOS simulator, it is just running it through the desktop version of Safari. I am not getting any errors. I am using the wdio test runner and this is in my config. Any suggestions?
capabilities: [
{
appiumVersion: '1.7.1',
deviceName: 'iPhone Simulator',
deviceOrientation: 'portrait',
platformversion: '9.0',
platformName: 'iOS',
port: '4723',
browserName: 'safari'
}
],
/
services: ['selenium-standalone', 'appium'],
appium: {
args: {
address: '127.0.0.1',
commandTimeout: '7200',
sessionOverride: true,
debugLogSpacing: true,
platformVersion: '9.0',
platformName: 'iOS',
showIosLog: true,
deviceName: 'iPhone',
nativeInstrumentsLib: true,
isolateSimDevice: true,
browserName: 'chrome'
}
},
I ended up getting this to work. I had set my config like so:
capabilities: [
{
maxInstances: 1,
browserName: 'safari',
appiumVersion: '1.7.1',
automationName: 'Appium',
deviceName: 'iPhone 7 Plus',
deviceOrientation: 'portrait',
platformVersion: '11.0',
platformName: 'iOS'
}
-
services: ['selenium-standalone', 'appium'],
appium: {
args: {
address: '127.0.0.1',
commandTimeout: '7200',
sessionOverride: true,
debugLogSpacing: true,
showIosLog: true,
nativeInstrumentsLib: true,
isolateSimDevice: true,
}
},
port: 4723,

Page keeps loading when tests run in headless mode using phantomjs

I am using Nightwatch.js with phantomjs to run tests in headless mode.
There is a loading icon provided before any page loads.
Issue: Whenever I run tests locally using chrome browser, all tests work fine but when I run same tests in headless mode(using safari here,tried with chrome as well: same result), it just fails at the page with the 'loading' icon always as if the page never loaded completely.
My nightwatch.json looks as follows:
{
"src_folders": [
"test"
],
"output_folder": "./reports",
"page_objects_path": "pages",
"globals_path": "./globals.js",
"selenium": {
"start_process": true,
"server_path": "./node_modules/nightwatch/bin/selenium.jar",
"host": "127.0.0.1",
"port": 4444,
"cli_args": {
"webdriver.chrome.driver": "./node_modules/nightwatch/bin/chromedriver",
}
},
"test_settings": {
"default": {
"silent": true,
"test_workers": true,
"detailed_output": true,
"launch_url": "http://localhost:3000",
"screenshots": {
"enabled": true,
"path": "./screenshots",
"on_error": true,
"on_failure": true
},
"desiredCapabilities": {
"browserName": "chrome",
"javascriptEnabled": true,
"acceptSslCerts": true
}
},
"headlessMacOSSafari": {
"desiredCapabilities": {
"browserName": "phantomjs",
"javascriptEnabled": true,
"acceptSslCerts": true,
"phantomjs.page.settings.userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/602.3.12 (KHTML, like Gecko) Version/10.0.2 Safari/602.3.12",
"phantomjs.binary.path": "./node_modules/.bin/phantomjs"
}
}
}
}
I have a globals.js file which includes:
waitForConditionTimeout: 15000
which is 15 sec still the tests always fail in headless mode at the same 'loading' icon place but always passes when runs locally.
Any help would be appreciated!