"Encountering issue with initiating WebDriver session" error while utilizing appium and protractor

Encountering a WebDriver session start error when initiating WebdriverIO with Appium and Protractor. This issue suddenly appeared without prior occurrence. Here are the console logs along with the configuration file details. Any assistance would be greatly appreciated.

Versions:
Protractor - 5.1.2 (latest)
Node - 7.9.0
Appium - 1.6.5

(node:27770) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
[14:57:35] I/launcher - Running 1 instances of WebDriver
[14:57:35] I/hosted - Using the selenium server at http://localhost:4723/wd/hub
[14:57:58] E/runner - Unable to start a WebDriver session.
[14:58:04] E/launcher - Error: WebDriverError: no such session
(Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Mac OS X 10.12.4 x86_64)
...

Also, find below the content of conf.js file:

'use strict';
var log4js = require('log4js');
var fs = require('fs');

exports.config = {
    capabilities: {
        browserName: '',
        platformName: 'Android',
        platformVersion: '6.0',
        deviceName: 'Moto',
        autoWebview: true,
        app: '/Users/abhishek/abhishek-test-volunteeringMobileApp/android-debug.apk'
    },
    baseUrl: 'file:///android_asset/www/index.html',
    framework: 'jasmine',
    specs: ['Specs/LoginSpec.js'],
    seleniumAddress: 'http://localhost:4723/wd/hub',

    jasmineNodeOpts: {
        defaultTimeoutInterval: 90000,
        showColors: true
    },

    onPrepare: function() {
        // Code for preparation
    }
}

Appium Logs:


[HTTP] --> POST /wd/hub/session
{"desiredCapabilities":{...}}
[MJSONWP] Calling AppiumDriver.createSession()...
...

Answer №1

It took some time, but I believe the answer lies within this section

[AndroidDriver] returning process name: com.volunteering.mobile [debug]
[AndroidDriver] Found webviews: ["WEBVIEW_com.volunteering.mobile"] [debug]
[AndroidDriver] Available contexts: ["NATIVE_APP","WEBVIEW_com.volunteering.mobile"] [debug]
[AndroidDriver] Connecting to chrome-backed webview context 'WEBVIEW_com.volunteering.mobile' [debug]
[AndroidDriver] A port was not given, using random port: 8000 [debug]
[Chromedriver] Changed state to 'starting' 
[Chromedriver] Set chromedriver binary as: /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/appium-1.6.0/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver 
[Chromedriver] Killing any old chromedrivers, running: pkill -15 -f "/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/appium-1.6.0/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver.*--port=8000" 
[Chromedriver] No old chromedrivers seemed to exist 
[Chromedriver] Spawning chromedriver with: /usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/appium-1.6.0/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver --url-base=wd/hub --port=8000 --adb-port=5037 
[Chromedriver] [STDOUT] Starting ChromeDriver 2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4) on port 8000 Only local connections are allowed. 
[JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:8000/wd/hub/status] with no body 
[Chromedriver] [STDERR] [warn] kq_init: detected broken kqueue; not using.: Undefined error: 0 
[JSONWP Proxy] Got response with status 200: "{\"sessionId\":\"\",\"stat... 
[ JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:8000/wd/hub/session] with body: {"desiredCapabilities":{"ch... 
[JSONWP Proxy] Got response with status 200: {"sessionId":"34eab4b4916a3eb08d701143c90c669c... [debug] 
[Chromedriver] Changed state to 'online' [Appium] New AndroidDriver session created successfully, session f25d0074-31d2-4c3e-9d37-784be5827545 added to master session list [MJSONWP] Responding to client with driver.createSession() result: {"platform":"LINUX","webSto... 
[HTTP] <-- POST /wd/hub/session 200 22185 ms - 881 
[HTTP] --> POST /wd/hub/session/f25d0074-31d2-4c3e-9d37-784be5827545/timeouts {"type":"script","ms":11000} [MJSONWP] Driver proxy active, passing request on via HTTP proxy 
[JSONWP Proxy] Proxying [POST /wd/hub/session/f25d0074-31d2-4c3e-9d37-784be5827545/timeouts] to [POST http://127.0.0.1:8000/wd/hub/session/34eab4b4916a3eb08d701143c90c669c/timeouts] with body: {"type":"script","ms":11000} 
[JSONWP Proxy] Got response with status 200: {"sessionId":"34eab4b4916a3... 
[JSONWP Proxy] Replacing sessionId 34eab4b4916a3eb08d701143c90c669c with f25d0074-31d2-4c3e-9d37-784be5827545 
[HTTP] <-- POST /wd/hub/session/f25d0074-31d2-4c3e-9d37-784be5827545/timeouts 200 9 ms - 220 
[HTTP] --> DELETE /wd/hub/session/f25d0074-31d2-4c3e-9d37-784be5827545 {} [ MJSONWP] Calling AppiumDriver.deleteSession() with args: ["f25d0074-31d2-4c3e-9d37-7... [debug]
[AndroidDriver] Shutting down Android driver [debug]
[AndroidDriver] Stopping chromedriver for context WEBVIEW_com.volunteering.mobile [debug] 
[Chromedriver] Changed state to 'stopping' 
[JSONWP Proxy] Proxying [DELETE /] to [DELETE http://127.0.0.1:8000/wd/hub/session/34eab4b4916a3eb08d701143c90c669c] with no body

I suspect that upgrading the logging level may reveal why it is failing. Perhaps the issue pertains to switching to the webview (especially if the webview isn't already in place) and setting the asynchronous timeout, as indicated by this line

[JSONWP Proxy] Proxying [POST /wd/hub/session/f25d0074-31d2-4c3e-9d37-784be5827545/timeouts] to [POST http://127.0.0.1:8000/wd/hub/session/34eab4b4916a3eb08d701143c90c669c/timeouts] with body: {"type":"script","ms":11000}
since failure occurs shortly after that.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Proper approach for mapping JSON data to a table using the Fetch API in a React.js application

Struggling to map some elements of JSON to a Table in Customers.jsx, but can't seem to figure out the correct way. How do I properly insert my Fetch Method into Customers.jsx? Specifically managing the renderBody part and the bodyData={/The JsonData/} ...

Error: Unable to access the 'TigerNo' property of an undefined object. Setting tempObj['TigerNo'] to the default TigerNo value from the sports record

I need some help with JavaScript programming. Although I am able to retrieve values in sportsRecord, I am encountering difficulties assigning them to tempObj['TigerNo']. Whenever I try to assign the value, I encounter the following error message ...

How to allow users to input strings on web pages with JavaScript

I created a Language Translator using java script that currently translates hardcoded strings in an HTML page. I want to enhance its flexibility by allowing users to input a string into a textbox/textarea for translation. Any assistance would be greatly a ...

Unable to modify page property status through the Notion API

I've been attempting to use the Notion JS-sdk to update a page's status using their API. However, I've run into some issues that I can't seem to resolve. Updating the status requires modifying the properties object, but no matter what ...

Guide for displaying and hiding an image using a button or link in Next.js

I'm a beginner with React and Next.js, and I have the following code snippet: import Link from 'next/link'; import Image from 'next/image'; async function getPokedex() { const response = await fetch(`http://localhost:3000/api/p ...

When clicked, elevate the element to the top of the window with an offset

Is there a way to click on this button, which is located within an accordion section header, and have it automatically move to the top of the page based on the window size? It seems like it should be a simple task, but sometimes after a long day things ca ...

When I use the Put method in Express, I receive a 200 status code, but no changes

Hello everyone, I recently attempted to implement my update function and tested it using Postman. I wanted to update the firstName field, but despite receiving a "HTTP/1.1" 200 response in the console, nothing was actually updated. This is the response bo ...

Error message: Unable to access properties of undefined object (reading 'authorization')

This is a snippet of code that handles user authentication and authorization const bcrypt = require("bcryptjs"); const jwt = require("jsonwebtoken"); const userRepository = require("../repositories/userRepository"); const SALT ...

Unable to print out all choices in selenium

I am having trouble retrieving all my options using Selenium Webdriver. Here is my sample HTML for the select element: And this is my PHP WebDriver sample code: See the code snippet below: $select = $driver->findElement(WebDriverBy::id('xcv&a ...

rotation of a Object3D in three.js

I am a beginner in using three.js and have encountered an issue with rotating a camera object. The rotation property has x, y, z values which I am curious about. I understand that the x, y, z values represent the radians of Object Euler angles, but accor ...

How to incorporate user-submitted form data into the existing state using React

I am currently working on a React project that involves a form input. The goal is for the user to input a number into the field, and then take that number and add it to another number in the application's state. For example, if this.state.data initia ...

Leveraging fetch for sending JSON payloads

I am currently facing an issue while attempting to post multiple points of data from a form input. Despite my efforts, it seems that the form data does not make it to the json output payload as expected. I have verified this through network output inspect ...

Tips for resolving conflicts with jQuery on an ASP.NET webpage

On this page, I am using references and scripts for a date time picker and color box. However, only one of them works at a time - commenting out one script allows the other to work. I have tried using jQuery noconflict, but it did not resolve the issue. H ...

Combining arrays to create a single object: A step-by-step guide

Here is the current output I have, which contains multiple arrays: ["{"486|575":2,"484|568":4}", "{"486|575":2,"484|568":4}", "{"481|570":1,"482|564":1}"] My goal is to combine these arrays into an object with the following output using JavaScript/jQuery ...

Struggling with updating scope values when binding data in Angular (particularly with a slider)

Currently, I am utilizing Angular to develop a tool that can take user input from a slider tool and dynamically update an "estimate" field whenever the values are adjusted. However, I'm encountering an issue where the data is only binding in one direc ...

Issue with Vue multiselect not updating selections

I am currently dealing with a functioning example of vue-multiselect. Despite its functionality, there are two persistent issues that need addressing. One problem arises when attempting to remove an option by clicking the x button, instead of actually re ...

Incorporate a loader when making an AJAX request and then conceal it after it has successfully completed

I find myself a bit puzzled here. Currently, I'm developing a JavaScript form that sends values to a PHP page (submit.php). If the PHP page returns a success message, I plan to redirect the user to another page (success.php). var url = 'submit. ...

Steps to partially open the Modal Sheet Swipe Step by default

I've set up a modal sheet component with the following structure: <f7-sheet class="myClass" style="height: auto" swipe-to-step :backdrop="false" > <div class="sheet- ...

Unexpected Error in Applying Color to Rows in EXTJS Grid

Currently, I am utilizing extjs 3.2 and recently experimented with a sample for coloring grid rows by referring to . I added a grid view configuration in the gridExample.js file which holds a static grid. viewConfig: { stripeRows: false, get ...

The ASP.NET Core MVC controller encounters a null input parameter when called by an ajax request

Here is the scenario involving an ajax call: ... $("#testBtn").click(function (e) { e.preventDefault(); $.ajax({ url: "/profile/GuestList", data: {"keytype": "1"}, method: "POST&q ...