The asynchronous callbacks or promises executing independently of protractor/webdriver's knowledge

Could a log like this actually exist?

07-<...>.js
...
Stacktrace: [31m[31mError: Failed expectation[31m
[31m    at [object Object].<anonymous> (...06-....js)[31m[31m[22m[39m

It seems that something is failing in file -06- while I am processing file -07- within a suite.

Is there a way to tell Protractor / webdriver.js not to wait for previous promises to be resolved? I doubt it, but perhaps there is a specific scenario where this can occur.

I apologize for the limited information provided. Unfortunately, I cannot share more details at this time.

This issue seems to be related to a previous one:

[32m46 tests, 11 assertions, 0 failures
[39m
[launcher] BUG: launcher exited with 1 tasks remaining

Additionally, there is another instance where an error stack trace appears after the tests, assertions, and failures line. For example:

     032 - "alert.msg" equals text: "invalid login"[32m✔[39m 033 - set detailTestLevel: 1
Finished in 3 seconds. Speed: 12.89 tests per second
Last Test Id: (ch_loginvalid_enUS_122_01)
[32m33 tests, 0 assertions, 0 failures
[39m
sh: 1: beep: not found

/home/*******/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1654
      var result = fn();
                   ^
Error: Index out of bound. Trying to access element at index:0, but there are only 0 elements
    at /home/*******/common/ext/ElementFinder.js:618:15
    ...
    (The error continues with additional stack traces)

Can you foresee a scenario where this might occur?

Protractor version: 1.7

Node version: 0.10.25

The code segment around ElementFinder:512 is shown below:

ElementFinder.prototype.itEqualsText = function(name, text) {
  if (_.isNully(text)) { text = name; name = this.originalName; };
  var elm = this; name = name || this.originalName;
  if (_.isNully(name)) throw new Error('needs name');
  if (_.isNully(text)) throw new Error('needs text');
  ... (Code continuation)

The code surrounding ElementFinder:618 looks like this:

// Fix current Protractor implementation so it keeps a reference to the
// original index as it was on previous Protractor versions: i.e. <= 1.2.0
ElementArrayFinder.prototype.get = function(index) {
  ... (Code details)

I inherited this codebase, so my understanding may not be complete. It appears to involve retrieving an array index from element.all("...").get(x).

Answer №1

At long last, I have discovered the resolution.

Protractor version 1.7 includes selenium-webdriver as a necessary component.

Therefore, if you are utilizing selenium-webdriver as a requisite and unable to avoid it for any reason, ensure that the version of selenium-webdriver in your package.json matches the one specified in Protractor's package.json (specifically 2.44.0).

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

Tips for Creating and Verifying JWE in Node.js

I attempted to use the following code in order to create an RSA-OAEP and A128GCM JWE generator and validator. It successfully encrypts claims and generates the JWE, then decrypts it and provides me with the original claims when running on node.js. However, ...

How to display currency input in Angular 2

Is there a way to dynamically format input as USD currency while typing? The input should have 2 decimal places and populate from right to left. For example, if I type 54.60 it should display as $0.05 -> $0.54 -> $5.46 -> $54.60. I found this PLUN ...

Insert the video link and preview it with live option

Currently working on a form that allows users to input a video URL. The form will be a standard input field where they can enter a URL such as: http://video.google.com/videoplay?docid=1299927595688205543 I want to include a button within the form labeled ...

The screenshot did not attach to the Allure report while running tests with TestNG

I have been struggling to get the following code to work for attaching a screenshot to an Allure report, but so far nothing has been successful. @Attachment(value = "{0}", type = "image/png") public byte[] makeScreenshotOnFailure(String fail, WebDriver d ...

Using JavaScript to issue a Windows authentication request for Kerberos

I have created a web API with Windows authentication enabled (using IIS as well). The issue arises when my client attempts to send an AJAX request to the web API, resulting in a 401 unauthorized response. Upon further investigation, it appears that the pr ...

Guide on releasing a TypeScript component for use as a global, commonJS, or TypeScript module

I have developed a basic component using TypeScript that relies on d3 as a dependency. My goal is to make this component available on npm and adaptable for use as a global script, a commonJS module, or a TypeScript module. The structure of the component is ...

Is there a method to track the progress of webpage loading?

I am working on a website built with static HTML pages. My goal is to implement a full-screen loading status complete with a progress bar that indicates the page's load progress, including all images and external assets. Once the page has fully loaded ...

Is it possible to make a form field inactive based on another input?

I need help with disabling certain form fields until other fields are filled in. You can check out an example of what I'm trying to achieve here: https://jsfiddle.net/fk8wLvbp/ <!-- Bootstrap docs: https://getbootstrap.com/docs --> <div ...

Transforming a Processing (cursor) file into an interactive webpage

I have created a custom cursor using Processing and now I want to incorporate it into my website. Is there a way to convert the cursor into a .java file so that I can include it in my HTML file? ...

Implementing bind to invoke a function during an onClick Event

Here is a code snippet I have been working on that demonstrates how to handle click events on hyperlinks. The code features two hyperlinks named A and B. When hyperlink A is clicked, the console will log 'You selected A', and when B is clicked, ...

Mocha maintains the integrity of files during testing

After running a unit test to update a config file, I noticed that the file was altered. My initial thought was to use "before" to cache the file and then restore it with "after". mod = require('../modtotest'); describe('Device Configuratio ...

Having issues with pageLoadTimeout function not functioning properly in Selenium framework

I have been trying to implement the following code using Selenium in Java. Even though I have set a pageLoadTimeout of 4 seconds, the driver still waits for the entire page to finish loading. Any suggestions on how to fix this? System.setProperty("webdr ...

One common issue popping up in Webpack logs is the error message "net::ERR_SSL_PROTOCOL_ERROR" caused by a call to sock

Using react on the front-end and .net core 3.1 on the back-end. Running webpack on localhost:8080 for client-side development. Configuring proxyToSpa in Startup.cs: applicationBuilder.UseSpa(spa => { spa.UseProxyTo ...

Using VueJS to showcase user input in a dynamic list and a pop-up modal

I am attempting to achieve the following: Use a v-for loop to display form input (name, position, company) as an unordered list, showing only the name input and a button for each person When a button is clicked, a modal will appear displaying all the data ...

Manipulate the default option in a Select field with JavaScript

I'm currently working on a WordPress post editing page and I need to set up a target link: By default, the option is set to "None", but I want to change it to "Custom Link..." with the following details: <select name="imt_team_href" onchange="imt ...

Having trouble initializing the canvas with fabric.js and Vue.js, as the function this.lowerCanvasEl.getContext is not recognized

When attempting to initialize a canvas in a VueJS component, I encountered an issue. Here is an example: https://jsfiddle.net/eywraw8t/55338/ I tried initializing the canvas in the mounted hook, ensuring that the DOM is available. Fabric seems to be worki ...

Utilizing Knockout to Render JSON List Items

Utilizing Knockout.js to dynamically update a view from JSON response has been my current focus. The structure of the JSON is as follows: var data = { "Properties": { "Engine Capacity": "1499cc", "Doors": 3, "Extras": [ "LED lights", ...

Tips for setting up a webpacked vue.js application with an express/koa backend!

Struggling with setting up a vue.js project for easy debugging in combination with a koa server? The cross-env NODE_ENV=development webpack-dev-server --open --hot command from the webpack-simple generated configuration looks promising, but how should it b ...

How can a button be linked directly to a particular list item?

I currently have a HTML tag within my React application that looks something like this: <ul> <li> Item 1 <button> Delete </button> </li> <li> Item 2 <button> ...

Looking for assistance in setting a new initial state for a javascript toggle on page load

Need assistance with customizing the Youtube-TV JS plugin for a client website? The current setup loads the player with a playlist in an open state, but the requirement is to load it with the toggle closed, displaying the array of playlists instead. If y ...