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

Selenium Python can be used to save a web page as a

Trying to print a webpage as a PDF with headers and footers to mimic the output from Google Chrome. Any suggestions? Experimented with PhantomJS but couldn't get it to include headers and footers. from selenium import webdriver import selenium def ...

Utilize the `addEventListener` and `removeEventListener` functions on the menu to

Why is my mobile menu not functioning correctly? The submenu should open on the first click and redirect to the parent URL on the second click, which works fine. However, when the window width increases to 768px or more, the submenu should appear on hover ...

What is the best way to create an XPath that can target specific data in an HTML table column that might change its position?

List<WebElement> brandNames = driver.findElements(By.xpath("//tbody/tr/td[1]")); I am attempting to create an xpath for "Brand Name" that will capture all the values under the "Brand Name". Each time I refresh, the "Brand Name" moves to an ...

Step-by-step Guide to Setting pageProps Property in Next.js Pages

When looking at the code snippet provided in .../pages/_app.js, the Component refers to the component that is being exported from the current page. For instance, if you were to visit , the exported component in .../pages/about.js would be assigned as the ...

Instructions for saving a binary file on the client using jQuery's .post function

I am working with a handler that has the following code: HttpRequest request = context.Request; HttpResponse response = context.Response; if (request["Type"] != null) { try { string resultFile = null; ...

What is the best approach: Referencing schema within properties or including it as an array in Mongoose?

Consider the scenario where we have two schemas, User and Post. Should we include a reference to User in Post's properties or should we add an array of Post schema inside User schema? Which approach is more efficient in terms of performance and other ...

What is the process for displaying user input on the console?

How can I ensure that the server is receiving user input? What steps should I take to print this input to the console? Currently, the console.log statement only displays "About to create new room", but I require the user input as well. Client-Side: // C ...

Avoiding metacharacters and utilizing them as a string variable for selection

For example, I have a variable called myid, and its value is "abc xyz". Then, I use a function to escape metacharacters and assign the result to another variable like this: var x = "#"+escapechars(myid);. The evaluated value of x is #abc\\xyz. ...

Exploring the meaning behind RxJS debounce principles

Referencing information found in this source: const debouncedInput = example.debounceTime(5); const subscribe = debouncedInput.subscribe(val => { console.log(`Debounced Input: ${val}`); }); When the first keyup event occurs, will the debouncedI ...

Invoking an *.aspx method from an external HTML file

Greetings, I am a newcomer to the world of web application development. I have successfully created an *aspx page that communicates with a webservice through a method returning a string. My next goal is to invoke this aspx method from a remote HTML 5 page ...

When the Ajax "GET" request is made to the intra-service, the CMS service worker will respond with an "OK" even when offline

Hello there, We are currently utilizing an open-source CMS that recently received an upgrade with a new feature - a javascript serviceworker implementation to manage all requests. This CMS includes workflow forms where users engage (created by us). Durin ...

Is it possible to manipulate elements within an overflow container using JavaScript/jQuery when using the HTML style "overflow:hidden"?

My <div> has a styling of style="overflow:hidden" and the size of the <body> is fixed, intended as a multi-screen display without a user interface. Is there a method to access these "invisible" elements to identify the first one that exceeds t ...

Creating Comet applications without the need for IFrames

Currently embarking on my journey to develop an AJAX application with server side push. My choice of tools includes Grizzly Comet on Glassfish V2. While exploring sample applications, I've noticed that most utilize IFrames for content updates on the c ...

What is the best way to convert JavaScript to JSON in Python programming?

I encountered a situation where I have an HTML page that contains a lengthy product list, making it too large for me to upload. The products are stored within the script section of the page, specifically in one variable. Initially, I mistook this data for ...

Error encountered: Unknown token '<' and Loading chunk 16 unsuccessful

Having a react app created with create-react-app, I encounter errors whenever I deploy to netlify and there is a new build. Uncaught SyntaxError: Unexpected token '<' 16.0fcd6807.chunk.js:1 Immediately after this error, another one pops up: ...

Redux - Refreshing the subtree state

How can I properly reset the subtree of a redux store without resetting the entire store? I want to target only the reducer subtree in question. Check out this example code: //initial state const initialState = { isFetching: false, error: '& ...

Passing methods from child to parent components in Vue2 looped componentsHere is a

Currently, I am iterating through the root component, which contains a child component within it. <root-select v-for="offer in offers" > <child-options v-for="item in options" > </child-options> </root-select> However, when ...

Unable to set the active tab using $rootScope

Is there anyone who can assist me with the issue I am currently facing? I have a NavCtrl to manage my active tags, and although I was able to change the active tab when clicking on the menu item, it does not update when clicking on links in the body views. ...

The JavaScript function modifies the value stored in the local storage

I'm in the process of developing a website that requires updating the value of my local storage when certain JavaScript functions are executed. Currently, I have this code snippet: localStorage.setItem('colorvar', '#EBDBC2'); I&ap ...

Ajax: The function assigned to the route does not get executed

Pressing a button triggers a confirmation box. If 'ok' is clicked, the div called 'EventData' should display the word 'reached'. The confirmation box appears when the button is clicked, but 'EventData' does not show ...