Is there a way to extract and store the numerical values from a string in Selenium IDE?

Is there a way to extract the confirmation number 135224 from the example below for use on another website?

store text | xpath=//b[contains(., 'Authorization Request - Confirmation Number : 135224')] | string

Unfortunately, I'm encountering an error message:

Error: missing ) after argument list

Below is the Selenium command I have attempted to solve this issue :

run script | javascript(myString(); function myString() {var auth = 'Authorization Request - Confirmation Number: ()' var confNum = auth.slice(47,52))} | auth Num

Answer №1

It appears that the last ")" has been misplaced in your code. Please consider the following correction:

 run script | javascript(myString(); function myString() {var auth = 'Authorization Request - Confirmation Number: ()' var confNum = auth.slice(47,52)}) | auth Num

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 on integrating the createjs library into a ReactJS project

Hey there! I'm currently working on developing a canvas-based app using ReactJS, and I need to integrate the CreateJS library. As a newcomer to ReactJS, I've been struggling to figure out the best approach. I've tried two different methods - ...

Having trouble interpreting the regex in the XPath locator while using the normalized-space and concat functions in Selenium

I dedicated countless hours to crafting the necessary regex for this xpath: //button[(@*[normalize-space()='concat('Let', "'", "s have fun!")' or text()[normalize-space()='concat('Let', "'", "s have fun!') ...

Merge two JavaScript functions into a single function

Upon inheriting some old code, I embarked on a mission to clean it up. Given that jQuery is being used on the site, utilizing it seemed like the best way to maintain simplicity and cleanliness. function address_finder_callback() { address_finder_sette ...

Encountering an Error with "Access-Control-Allow-Origin" Request While Trying to Access the API

I'm currently facing an issue with fetching data from the Rescue Time API. My request is made in a JavaScript file using the jQuery get() method. Below is the snippet of JavaScript code related to the API GET request: $.get('https://www.rescueti ...

Selenium - Activating a flash button

Currently, I am facing an issue while trying to load a URL using Selenium on Mozilla browser. The webpage contains a 'Login' button created in flash that I need to click on. I have explored the following resources: 1.How to click an element in Se ...

Display or conceal various content within div elements using multiple buttons

I have a set of 5 image buttons, each meant to trigger different content within a div. When the page loads, there should be default content displayed in the div that gets replaced by the content of the button clicked. The previously displayed content shoul ...

What's the best way to modify HTML element classes using Javascript?

I have designed a custom cms theme with various customization options that I wish to showcase in a live demo. My goal is to implement Javascript style switchers or modifiers where users can choose values from checkboxes or select tags, and see their select ...

Using a JSON web token (JWT) for authorization on a json-server

I am currently working on developing a Node.js application that utilizes typicode json-server. My goal is to implement authorization within the app, where all public users have access to GET requests, but PUT, POST, and DELETE requests require a JWT token ...

Using Selenium on Mac OS and Windows operating systems

What are the key distinctions in running Selenium Java on Eclipse between Mac OS and Windows operating systems? Are there significant differences that need to be considered? ...

Enhance your website with dynamic JavaScript link editing functionality

My internal search engine is displaying search results in a specific format, like so: Currently, the JavaScript on the page adds attributes such as "target=blank" and #search="query_String" to each link in the search results. I am attempting to modify th ...

How to convert DateTime format from database to input type='datetime' using PHP

I am having trouble retrieving a column from the database of type datetime and passing it to an input box with the type 'datetime' in my form. Unfortunately, nothing is being passed. <input type="datetime-local" id="myDate"> <button id= ...

What is the best way to fetch the most recent article from every category using mongodb?

I am currently working with the following article schema: var articleSchema=new Schema({ id : Number, title : String, sefriendly : String, created : Date, categories: [ { id: Number, name: String, ...

"Using Laravel and Ajax, the foreach loop in the Controller is configured to return a singular

When attempting to retrieve names from the database using Ajax and a foreach loop in the controller, only one name is returned instead of both. I have explored solutions where people suggest using foreach in the view, but since I am using Ajax in the view, ...

What methods and technologies are accessible for executing JavaScript through PHP?

Are there any frameworks or tools available to execute JavaScript from PHP? Is there a similar project like the Harmony project for PHP? I am interested in running JS unit tests (or even BDD) directly from PHP, as demonstrated in this post (for Ruby). Am ...

Transitioning from one CSS id to another during page loading

Wondering how to fade in one CSS id on page load and then smoothly transition to another after a few seconds? Here are the ids: #background { background: url("images/am_photography_bg.jpg") no-repeat center -25px fixed; background-size: 100%; ...

Can variables in JavaScript clash with input names in HTML?

I have the following code in an HTML file: <input type="..." name="myInput1" /> Then, in a JS file associated with this HTML file, I declare a variable to store the value of that input after it loses focus: var myInput1; Should I be concerned abo ...

Next.js has a problem where it displays incorrect data when users navigate rapidly between pages

An unusual challenge has emerged while rendering data on a Next.js page in my application. Here's the scenario: I've created a Next.js page that showcases customer details based on a query parameter called cid. The page retrieves customer data an ...

The Evolution of Alternatives to contentEditable

Related: ContentEditable Alternative I am curious about the timeline of online WYSIWYG editors prior to the existence of contentEditable. I remember using GDocs and GMail with rich-text features that functioned similarly to contentEditable. I would appre ...

Advantages of using jQuery's .each() function instead of conventional "for" loops

I recently had a colleague recommend using jQuery's .each() function instead of a standard javascript for loop for traversing through DOM elements on my webpage. While I am familiar with jQuery, I've always wondered why developers prefer using .e ...

Simple guide to identifying when the content of a dropdown option changes using jQuery

I am seeking a solution for detecting changes in the options of a dropdown field that are updated dynamically. Is there a method to capture an event each time the set of options within the dropdown is modified? I am not looking to track individual option ...