The unexpected error in Selenium occurred due to an Exception at fileName -> chrome://selenium-ide/.../selenium-api.js, lineNumber -> 2535, and columnNumber -> 0

I am attempting to extract text from an element and store it in a variable. I then want to grab a specific portion of that text using the substring method, save it in another variable, and use it to search for similar text on a different webpage.

Below is the code snippet:

storeTextPresent - css=div#titol-pantalla > h2 - var_nCtr

storeEval - javascript{storedVars['var_nCtr'].substring(12,23)} - var_simul

However, when executing this code, Selenium throws the following error:

[error] Unexpected Exception: fileName -> chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js, lineNumber -> 2535, columnNumber -> 0

I initially thought the issue might be related to Chrome, but even after uninstalling it, the error persists.

I also attempted adding ":" between "javascript" and the curly braces:

storeEval - javascript:{storedVars['var_nCtr'].substring(12,23)} - var_simul

Unfortunately, this modification did not resolve the error either.

Following advice from a forum post, I tried eliminating the "javascript" keyword:

storeEval - {storedVars['var_nCtr'].substring(12,23)} - var_simul

Despite these attempts, the issue remains unresolved.

I have researched extensively online but found no definitive answers to address my problem.

Answer №1

Here is a code snippet to try out:

<tr>
    <td>storeText</td>
    <td>css=div#titol-pantalla</td>
    <td>var_nCtr</td>
</tr>

<tr>
    <td>storeEval</td>
    <td>var var_nCtr= &quot;${var_nCtr}&quot;; var_nCtr.substring(6, 8);</td>
    <td>test</td>
</tr>
<tr>
    <td>echo</td>
    <td>${test}</td>
    <td></td>
</tr>

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

Grant access to microphone and camera permissions on Edge browser through the use of selenium

Currently, I am executing selenium scripts on the Edge browser. There is a certain functionality that requires initiating an audio or video call between two windows. In Chrome, we can utilize 'use-fake-ui-for-media-stream' in Chrome options for t ...

Customizing multi select in MUIv5 AutoComplete feature

My current challenge involves using the mui Autocomplete multi-select component. I'm having trouble getting it to function according to my specific requirements. Essentially, I need to set default selected values passed as props from the Parent compon ...

Do you understand why my Fabricjs canvas is rejecting a rectangle?

http://jsfiddle.net/a7ZSG/10/ check out the link to the jsfiddle for more information. Having trouble getting a red rectangle to appear in a green canvas? Can anyone figure out why it's not showing up? I've attempted using window.onload around a ...

"Position the div to appear on top of everything without causing the

Currently, I am working on a gallery project where I have successfully implemented functionality to open and close it using separate buttons. However, I am facing an issue where I want the opened gallery to be positioned above all other content on the page ...

Acquire the accurate x and y coordinates upon mouse hovering

<div v-for="day in week.days" :key="day.timestamp" @mouseover="selectDate($event,day)"> </div> <div v-show="displayEvents.length!=0" ref='eventList' style= " background:red; height:mi ...

Is it beneficial to utilize components in order to streamline lengthy HTML code, regardless of whether the components do not repeat and do not require any props (such as in Vue or any other JavaScript library

In the Vue.js team project I am currently involved in, I have structured my code in the view as follows: component01 component02 ... There are more than 10 components in total. Each component represents a section of the landing page, consisting mostl ...

nextJS does not recognize the term 'Window'

I'm encountering the error "window is not defined" in my NextJS project. The variable isMobile determines whether the window size is less than 767.98 to handle the hamburger menu functionality. This code worked in ReactJS but seems to be causing issue ...

Tips for preventing hint text from appearing in a textbox with the help of JavaScript

I am currently developing a basic login form with two input fields for the username and password. The username field has the hint "user name" displayed inside it. The password field displays the hint "password." My goal is to hide the hint text when the ...

Link the ng-model to an asynchronous function for fetching and updating data

After struggling with my previous attempt to solve a question, I have decided to present it here without any prior attempts. (You can view my previous topic here: ng-model to async xhr get/set field on my server ) Working with angular in a browser addon, ...

Methods for organizing an array of objects by a specific key in JavaScript, but in the case of duplicate values, the objects can be sorted by a different

I'm struggling to sort an array of objects by two different keys. I need to first sort the array by price, and if there are multiple items with the same price, they should then be sorted by time. Here's what my array looks like: var myArr = [ {&q ...

What is the best way to transfer a JavaScript object with string values containing quotes from node.js to the browser?

I have a node/express application and need to send a JavaScript object to the browser. Currently, I achieve this by using JSON.stringify on the object and then embedding it into the HTML: In my Node.js/Express code: var myObject = /* fetched from databas ...

Exploring a nested JSON structure using AngularJS's Ng-Repeat directive

I am facing an issue with displaying all elements of subcategory using Ng-Repeat. I have managed to show all events from the selected category with this code, but I am unsure how to display all activities from a specific event. I currently have this code.. ...

The set operator in Firestore does not append any new documents to the collection

I recently implemented a promise chain to store user data in Firestore and handle authentication, but I encountered an issue. Initially, I used the add operator to save the data, but later decided to assign users based on their unique UID. After making thi ...

How can React and Redux ensure that response data is accessible to every component?

When using react and redux, how can data written in the useDispatch function be made available in other components? Additionally, how can the customerId be accessed in all components? I have created a code that calls an API and returns data in response. I ...

The Chrome Binary Stacktrace is elusive to Selenium in the current environment

I'm currently utilizing Selenium for a web scraping script and everything runs smoothly in general. However, when attempting to run the script in a different environment, I encountered the following error: Traceback (most recent call last): at block ...

The React error message refuses to disappear even after attempting to refresh the page

Currently, I am immersed in a React project where I have encountered an issue on the Register Page. All errors are being added to a Message component. Interestingly, even after encountering a React error (such as 'Cannot read properties of undefined&a ...

Is there a way to prevent the conversion of .json/.webmanifest URLs into base64 strings?

I've been grappling with an issue for quite some time now. In my VSCode vite-react-typescript project, I have a link in the index.html file pointing to a webmanifest, which is essentially a json file with a different extension. After building my app, ...

Showcase a sizable picture broken down into smaller sections

I am interested in creating a mapping application similar to Google Maps that can asynchronously load images from the backend. I am seeking guidance on where to begin and how to proceed in this endeavor. The ultimate goal is to have the image displayed w ...

Navigating Through Nested Elements with Selenium Using CSS Selectors for BootStrap Styling

Hey everyone, I'm working on a web page that's structured in bootstrap and I need to access the elements of my dropdown menu. I've been using the Firefox Selenium IDE to obtain the XPath, which validates successfully showing that the path ex ...

Discover siblings in React component siblings

Creating a parent element (Board) that generates a list of children and provides a method to access this list can be done like so: export default class Board extends React.Component { constructor(props) { super(props); this.getList = t ...