Issues with executing JavaScript code within a pop-up window using Selenium IDE

Encountering difficulties while trying to test a pop-up menu using Selenium IDE.

The issue arises when attempting to click on a button within the pop-up that triggers a JavaScript function to update a list and close the pop-up.

Although the test is programmed to click on the button, the JavaScript function fails to execute and the pop-up remains open.

Interestingly, manually double-clicking on the command resolves the problem, or splitting the test into two separate cases allows successful execution.

Has anyone else experienced this issue before and can provide insight into what might be causing it?

verifyElementPresent | //td[2]/a/img | |
click | //td[2]/a/img | |
waitForPopUp | lookup | 30000 |
selectWindow | name=lookup | |
click | Checkbox1 | |
click | //table[@id='Table2']/tbody/tr/td[1]/a/img | | 

Answer №1

I managed to find the solution on my own by simply accessing the element using tag name and utilizing the runScript command!

|verifyElementPresent | //td[2]/a/img | |
|click | //td[2]/a/img | |
|waitForPopUp | lookup | 30000 |
|selectWindow | name=lookup | |
|click | Checkbox1 | |
|storeEval | selenium.browserbot.getCurrentWindow().document.getElementsByTagName('a')[3]|test |
|echo | ${test} | |
|echo: javascript:save();
|runScript | ${test} | |
|close | |  

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

"Implement a script to automatically reload within a loop if there is a

When my script visits various websites, occasionally it times out and results in the following error being thrown by Traceback: Traceback (most recent call last): File "C:\Python27\visitor.py", line 52, in <module> wait.until(EC.pres ...

JavaScript event triggered upon full completion of page rendering

Similar Question: How can I execute a JavaScript function after the page has fully rendered? I am aware that the onload() event can be utilized to perform actions once the page is completely loaded. Is there an equivalent event that signifies when the ...

What is the best way to incorporate a JavaScript function into an Angular 2 template?

I need a slider for my project and I am using AdminLTE <input type="text" value="" class="slider form-control" data-slider-min="-200" data-slider-max="200" data-slider-step="5" data-slider-orientation="horizontal" data-slider-sele ...

Show symbols exclusively on masked pictures

Our json files contain two types of images for processing... 1. Mask images These images have a transparent background, as shown below: https://i.sstatic.net/I7R5j.png 2. Background images : Any normal images I am currently displaying icons on all ...

Passport authentication leading to incorrect view redirection in Express

I'm struggling to understand why the URL is updating but leading to the incorrect view. Once a user is authenticated with passport, the URL changes to my code (/clients) but it redirects back to the homepage view. After authentication, I want the us ...

What is the best way to remove the class "active" from only one of the <li> elements using jQuery?

I am currently facing a challenge in figuring out how to remove the "active" class from just one of my lists. Here is an example of my navigation bar: <div class="container"> <ul class="nav"> <li class="active"><a href="#">& ...

Why am I encountering an issue while trying to access req.user.id?

Having set up passport authentication on my express, node project, I encountered an error when trying to access req.user. The error message displayed is Property 'id' does not exist on type 'User'.ts(2339). Below is the relevant code sn ...

Is it possible to spread an empty array in JavaScript?

Whenever I run the code below, I encounter the error message Uncaught SyntaxError: expected expression, got '...': [1,2,3, (true ? 4 : ...[])] I'm wondering if spreading an empty array in that manner is allowed? ...

Help needed with parsing nested JSON using the $.each function

Here is a JSON response sample that needs to be parsed in a more generic manner, rather than using transactionList.transaction[0]. "rateType": interestonly, "relationshipId": consumer, "sourceCode": null, "subType": null, "transactionList": { "transac ...

What is the method for exporting a variable from a module in JavaScript?

Based on information from this forum post, it is possible to export variables from one module to another in JavaScript: // module.js (function(handler) { var MSG = {}; handler.init = init; handler.MSG = MSG; function init() { // Initialize t ...

Beautifulsoup is employed to overwrite data

Encountering an issue while scraping data where it keeps getting overwritten and only provides information from 2 pages in the CSV file. Looking for a solution to prevent this problem. I've tried multiple methods, including changing file modes, but no ...

What is the best way to identify when a cell has been modified in ng-grid aside from just relying on the ng-grid event

My web application features an editable ng-grid that has greatly simplified my work, but I have encountered a minor issue. I need a way to detect when a user makes changes to the grid without having to compare each field before and after. Currently, I am ...

Looking to install nodemon for Node.js on macOS? If you're encountering a "command not found" error, here's

After installing nodemon using the command npm install -g nodemon, I encountered a Permissions issue. To resolve this, I used the sudo npm install -g nodemon command. However, when attempting to run the "nodeman" command, I kept receiving an error that s ...

Encountering an issue while attempting to utilize the .find() method in Mongoose

Currently, I am in the process of setting up a database using MongoDB and integrating the Mongoose ODM with Node.js. After running the code multiple times without any issues, I encountered an unexpected error when adding the last block to utilize the .find ...

How can a JS script determine the shape of a quadrilateral based on its properties?

Hi there! I'm new to coding and could use some guidance. I've been given a task to create a script that takes input for the length of each side and the angles of each corner in order to determine whether the shape is a square, rectangle, rhombus ...

Having trouble connecting v-model to vue-date-picker

My experience with the vue-date-picker and v-model for two-way data binding has been interesting. Initially, I set the value to a date (referred as startDate in this case) and printed the passed value (i.e. startDate) in the console. The initial value pa ...

Master the ins and outs of working with Angular and Webpack on

Encountering issues with the webpack-angular tutorial from egghead.io during the "ES6 with Babel" step. Requesting assistance in resolving the problem. Stuck at this specific step while following the tutorial: Error message in Chrome devTools: ........ ...

Phonegap: Displaying audio controls and metadata for my audio stream on the lock screen and in the drop-down status bar

After successfully creating my initial android app for phonegap 5.1 that plays an audio stream, I am currently facing an issue. I am unable to locate any solutions: How can I display audio controls and metadata of my audio stream on the lock screen as well ...

Namespace remains ambiguous following compilation

I'm currently developing a game engine in TypeScript, but I encountered an issue when compiling it to JavaScript. Surprisingly, the compilation process itself did not throw any errors. The problem arises in my main entry file (main.ts) with these ini ...

Allowing unauthorized cross-origin requests to reach the SailsJS controller despite implementing CORS restrictions

My cors.js file has the following configuration: module.exports.cors = { allRoutes: true, origin: require('./local.js').hosts, // which is 'http://localhost' } I decided to test it by making a request from a random site, Here is ...