Navigating array usage in Selenium IDE

I am trying to extract emails from a webpage using Selenium for future testing. I need to compare these emails with ones displayed in a selection later on.

I attempted to read the emails within a while-loop but struggled with handling arrays in IDE. Unfortunately, my current approach is not working:

store | 0 |i
store | 17 | line
storeElementPresent | //html/body/div/div[4]/*/div[3]/table/tbody/tr/td/table/tbod/tr[${line}]/td[3]/a |adresseDa
while | ${adresseDa}!='0' 
storeEval | javascript{new Array()} | array
storeText | //html/body/div/div[4]/*/div[3]/table/tbody/tr/td/table/tbody/tr[${line}]/td[3]/a | mail
storeEval | storedVars.array[storedVars.i]=storedVars.mail 
echo | ${array}
storeEval | storedVars.line++
storeEval | storedVars.i++
storeElementPresent | //html/body/div/div[4]/*/div[3]/table/tbody/tr/td/table/tbod/tr[${line}]/td[3]/a | adresseDa
endWhile

The echo | ${array} output is null, indicating that something is wrong with my method.

I need guidance on how to properly store the emails in an array and access them later. Any suggestions would be greatly appreciated!

Thank you!

Answer №1

Successfully discovered a solution :) Storing emails in an array:

store   | 17    | line
storeElementPresent  |//html/body/div/div[4]/*/div[3]/table/tbody/tr/td/table/tbod /tr[${line}]/td[3]/a | adresseDa
while | ${adresseDa}!='0'   
storeText | //html/body/div/div[4]/*/div[3]/table/tbody/tr/td/table/tbody/tr[${line}]/td[3]/a  | tempMail
store   | javascript{storedVars['tempMail'].substring(7,100)} | mail
push    | ${mail}  | mailArray
echo    | ${mailArray} 
storeEval | storedVars.line++       
storeElementPresent | //html/body/div/div[4]/*/div[3]/table/tbody/tr/td/table/tbody/tr[${line}]/td[3]/a | adresseDa
endWhile 

Verification of email array against DropDownMenu on a different webpage:

verifySelectOptions |   //*[@id="mainForm:Emailadresses"] | ${mailArray}

For the push and while functions, you can access an extension from this link:

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

Just as my selenium webdrivers begin to open, the chrome.exe unexpectedly exits after a few seconds

I have been attempting to execute a basic selenium program that is supposed to open a website. However, whenever I input the code, the Chrome application only stays open for a few seconds before the terminal displays the following error message. Here is th ...

Utilizing jQuery for resizing images

I'm encountering an issue with my Jquery code as I work on creating a gallery feature. My goal is to have the selected image appear in the center of the screen when clicked, resized to fit the screen size if necessary. However, I've run into perf ...

"Bower fetches and installs specific versions of packages from the repository

I'm currently using npm 3.3.6 and bower 1.6.8 on Windows 10. Whenever I attempt to install a package like jquery or framework7, it ends up downloading and installing an archived version of the package. Here's an example: > bower install jquer ...

Tips for securing a navbar in material ui

https://i.stack.imgur.com/CYfmQ.png In my current React project, I am facing an issue with aligning components within the Material-UI AppBar Component. My aim is to achieve a seamless and perfectly straight alignment for three key elements: a logo image, ...

Issue encountered when trying to insert an array in JavaScript into MongoDB using Mongoose

I am currently learning about node.js and mongodb. I attempted to insert a JavaScript array variable into mongodb using mongoose, but encountered an error. Upon running this code, I received the following error message: ValidationError: CastError: Cast t ...

Is it possible to utilize AND (&&) OR ( || ) operators within the dependency array of React JS?

Is it possible to include the && and/or || operators in the dependency array like this: const isVisible = true const isModified = false useEffect(() => console.log("both are true"), [isVisible && isModified]) Some may consider this to ...

Creating Projects Without a Build System in Sublime Text 3

I'm having trouble getting the sublime build system to function properly. When attempting to run my code, I receive a "No Build System" error message. I have already set the build system to Automatic under Tools->Build Systems and saved the file a ...

What could be causing the 404 Ajax not found error in my script?

I'm facing an issue with my code. When I try to run it, I encounter the following error: 404 (Not Found) while using the get method. Here is my html code snippet. <html> <head> <title>Issue</title> <meta charset= ...

How to handle blank property values in JavaScript objects and convert them to null in an ASP.NET Web API

Hey there! I'm facing an issue where when I post a JavaScript object to an ASP.NET Web API, some property values are blank like the example below: var o={ ID=1, Fname="Tom", Mname="", Lname="Wilson" } However, in the Web ...

The formatter/render function in Angular Directive fails to refresh

Recently, I created a straightforward directive that converts minutes into a range slider while also displaying hours and minutes alongside. However, I encountered an issue where although moving the range slider updates the scope triggering Watch and Pars ...

The error message "POST .../wp-admin/admin-ajax.php net::ERR_CONNECTION_CLOSED" appears when a WordPress AJAX request receives data that exceeds 1MB in size

When I attempt to submit a jquery ajax form from the frontend and upload a blob (a variable of string) as a .txt file to WordPress using wp_handle_upload(), everything works smoothly until the file size reaches around 1mb. At that point, an error is displa ...

Can files in a directory be listed using JavaScript without the need for HTML tags?

Currently, I am exploring ways to automate an Angular application using Protractor. During this process, I encountered a situation where I needed to retrieve a list of all the files within a specific folder. In Java, I am aware that we can accomplish this ...

`Encountering an unknown index while using AJAX to retrieve data from a PHP file

When using AJax to call a PHP file and retrieve values, I encountered an issue where the called PHP file returns an unidentified variable upon submission. Here is the script being used: <script> function showPrice(str) { if (str == "") { ...

Any suggestions on how to retrieve data into Tabulator using the POST method?

I am currently utilizing Tabulator 4.6 and have an API that supports the POST method. My goal is to retrieve data from Tabulator through a POST request instead of a GET request. Within my org.js file, I have the following configuration: var ajaxConfig = { ...

Guidelines for integrating deep links into a ReactJS Ionic Android application

I have recently converted my ReactJS project into an android project following a tutorial. Now, I have successfully created an APK file and would like to configure the app to open when a specific URL is clicked on a mobile browser. Any guidance on how to a ...

Encountering a 'connection refused' error while trying to execute Selenium with a Headless Firefox browser

My current setup includes Selenium 3.4.0, GeckoDriver v0.19.0 for Linux 64-bit, and Firefox 52.4.0. This is my first time posting a question on this platform. Normally, I can find solutions by browsing through discussions, but this particular issue has be ...

Could anyone clarify the reason behind the success of one function while the failure of the other?

Currently delving into the world of React, I decided to follow along with the Road To React book. In this guide, the author presented this code const List = (props) => ( props.list.map(item => ( <div key={item.objectID}> & ...

Continuously flowing chain of replies from a series of queries using RxJS

I am exploring the world of RxJS and seeking guidance from experienced individuals. My goal is to establish a synchronized flow of responses, along with their corresponding requests, from a stream of payload data. The desired approach involves sending ea ...

In Javascript, the difference between defining a variable using "this.varName" and "var varName" lies in the scope of the variable

Excuse my JS ignorance, but here's a question: In JS, I've noticed functions that define variables inside them like this: function functionName(){ this.something = ""; }; I'm wondering if something is considered a local variable. W ...

Updating a single document in Node JS using Express is a simple and straightforward process

I'm having trouble understanding why my documents aren't updating. When I retrieve any record and load it into the form using http://localhost:3000/update2?buyerID=2299, the field doesn't update when I make changes and click submit. It rema ...