Error: protractor encountered an unexpected issue

Currently, I am following this tutorial

I went through all the steps mentioned in the tutorial except for what was suggested in this post
instead of

npm install -g protractor

I opted for

npm install -g protractor --no-optional

So far, I have successfully completed Step 0 - write a test

expect(browser.getTitle()).toEqual('Super Calculator');

However, when I proceeded to Step 1 - interacting with elements

element(by.model('first')).sendKeys(1);

This resulted in an error:

Using the selenium server at http://localhost:4444/wd/hub
[launcher] Running 1 instance of WebDriver
F

Failures:

  1) Protractor Demo App should add one and two
   Message:
     UnknownError: null
   Stacktrace:
     UnknownError: null
   //... continue stack trace

After trying to access a dom element by using:

element(by.model('firstXXX')).sendKeys(1);

I received this message:

NoSuchElementError: No element found using locator: by.model("firstXXX")

What do you think could be causing the error message mentioned above?

Message:
     UnknownError: null

In addition, here is the output from webdriver-manager start console:

16:41:27.526 INFO - Executing: [send keys: null null, [1]])
16:41:27.527 WARN - Exception thrown
java.lang.NullPointerException
        at org.openqa.selenium.remote.server.handler.SendKeys.call(SendKeys.java:49)
        at org.openqa.selenium.remote.server.handler.SendKeys.call(SendKeys.java:1)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:168)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
16:41:27.530 WARN - Exception: null
16:41:27.658 INFO - Executing: [delete session: 157e0397-52e0-4d03-b8ee-aef453cd83a2])
16:41:28.843 INFO - Done: [delete session: 157e0397-52e0-4d03-b8ee-aef453cd83a2]

Answer №1

It is advisable to address any issues related to the seleniumAddress, although you have the option to automate Chrome and Firefox using directConnect. A sample configuration can be found here.

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

Vue - Pull out several components from main file

In my Vue.js project, I have been using the .vue component specs format to write components. An interesting observation I made is that plain JavaScript can export these components when loaded from vue files. For instance, a component defined in index.vue c ...

Searching for multiple array elements based on their values can be achieved by using various techniques

I am trying to find a way to select multiple elements from an array that share the same value. When I use array.find(), it only returns the first element that matches the condition. For example, in the code below, only "Donald Trump" is displayed in the co ...

Is it possible to use header() function in a file that is being accessed through

In a specific package, there is a crucial file that verifies session data and redirects the user to the login page with an error message if no valid session exists, using header("Location:" . $var);. This particular file is included in almost all files wi ...

Copying the position of one object to another in THREE.js does not function as expected

Recently I started experimenting with Three.js and I’m currently working on a project where I need to position a SpotLight at the same coordinates as the camera. Below is the code snippet I’m using: $(document).ready(function() { init(); }); func ...

The issue with the functionality of position absolute in CSS when used with JavaScript

<html> <head> <style> #wrapper{ position: absolute; top : 250px; width: 500px; height: 500px; border: 1px solid red; } .tagging{ position: absolute; border: 1px solid black; width : 20px; height: 30px; } & ...

Tips for utilizing the ng-filter Json [@attributes] with Angularjs

I'm trying to sort through sports feed based on sport ID, but the JSON feeds are structured with @attributes. JSON Feeds series: [ { @attributes: { id: "cdf590b4-0206-45b0-9122-20eae46a2b27", name: "Pakistan tour of Sri Lanka, 2015", year ...

Error: Attempting to access 'forEach' property on an undefined variable at line 10 in the script file

I'm completely new to Javascript and I apologize for my messy code. I've been struggling with this error for a while now, both on Replit and Visual Studio, but I can't seem to figure it out. Any help would be greatly appreciated! Every time ...

Ways to retrieve resolved values in a template without the use of double curly brackets

I'm currently using a directive and template. Here is my template: <div> <a data-my-dir="item" data-attr1="true" data-attr2="{{itemParentId}}" data-attr3="{{item.id}}"> </a> </div> The use of curly bra ...

What is the typical number of open CLI terminals for a regular workflow?

After experimenting with Gulp, Bower, ExpressJS, and Jade, I have settled on a workflow that I am eager to switch to. The only issue I am facing is the need to have two terminals open simultaneously in order to use this workflow efficiently. One terminal ...

Retrieve a specific value in HTML <a> tag using JavaScript-Ajax in Django

I am currently working with Python 3 and Django. Within my HTML code, I have the following: {% for category in categories() %} <li class="c-menu__item fs-xsmall"> <a href="#" id="next-category"> {{ category}} & ...

Issue: Error occurs when using _.sample on an array containing nested arrays

I am working with an array of arrays that looks like this: [[0,0], [0,1], [0,2], [0,3]...] My goal is to randomly select N elements from the array using Underscore's _.sample method: exampleArr = [[0,0], [0,1], [0,2], [0,3]...] _.sample(exampleArr, ...

The precision of the stopwatch is questionable

Just starting out with JS and jquery, I quickly put together a stopwatch code in JS that seems to work accurately up to 10 minutes. The issue arises after the 10-minute mark where it starts falling a few seconds behind (I compared it to a digital stopwatc ...

Ways to unzip binary information in node.js

Once I have decoded my data from base 64 to binary, my next step is to unzip this information. In my project, I am using node.js instead of PHP, which has a convenient gzdecode() function for decompressing data. However, with node.js, I am unsure of how t ...

The 'npm start' command is failing to recognize the changes made to the

I am embarking on a new node application journey, starting with the package.json below, which is quite basic. { "name": "mynewnodeventure", "version": "1.0.1", "description": "Exploring node", "main": "index.js", "start": "node server. ...

I have a quick question: What is the most effective method for creating PDF templates with Angular and .NET 6, specifically for designs that feature heavy

Seeking the optimal solution for creating PDF templates using Angular and .NET 6? Specifically looking to design templates that heavily feature tables. In my exploration of efficient PDF template creation with Angular and .NET 6, I ventured into using pdf ...

Having trouble getting Javascript Jquery to function properly?

There is a button that, when clicked, changes the HTML in the body tag to include a new button. However, when this new button is clicked, it should trigger an alert message but it is not working as expected. I suspect that the issue lies with the document ...

Add the content of a JavaScript variable to a label without using any scripting

Is there a way to concatenate the value of a JavaScript variable with a label without utilizing jQuery? For example: Var global_message = "1234"; <label id="my-label">Test</label> I desire the concatenated value "Test1234" to be displayed o ...

Exploring the concept of parent-child coupling in React and its connection to context

While delving into React's documentation on Context > Parent-child coupling, I found myself struggling to grasp the concept of parent-child coupling. One particular line stood out: By passing down the relevant info in the Menu component, each Me ...

Exploring the power of Typescript functions within a traditional VueJS project

TL;DR: How can I import and use a typescript module into my plain js Vue-Components? I have a Vue 2 (not yet 3) project. In this specific project, I have made the decision to refactor some of the code logic into ES modules for improved testability and reu ...

Streamline your processes by automating jQuery AJAX forms

I am looking to automate a click function using the code snippet below in order to directly submit form votes. Is there a method to develop a standalone script that can submit the votes without requiring a webpage refresh: <input type="submit" id="edit ...