The dropdown within the modal is proving elusive for Selenium to locate

I am attempting to choose a value from the dropdown menu labeled 'ddl_settpymtaction' using Selenium, but unfortunately it seems to be unable to locate it within the modal where it is located.

CSS:

https://i.stack.imgur.com/3YWQu.png

Selenium code

 driver.FindElementById("btn_SettlementNew").Click();
        var Action = driver.FindElementById("ddl_SettPymtAction");
        var SelectElement2 = new SelectElement(Action);
        SelectElement2.SelectByValue("EFT");

Answer №1

When working with Selenium, it's important to remember to include a delay when dealing with asynchronous operations, especially those involving modals that are loaded with animations and AJAX calls.

But why is this necessary? Allowing for a delay gives your page the time it needs to render properly, ensuring that Selenium can inspect the page at the appropriate moment after all required elements have been loaded.

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 Action chains are designed to perform a double click instead of a single click

I have a question about using actionchains to click on multiple buttons consecutively. The issue I am facing is that instead of performing a single click, my code seems to be executing a double click: y_off = 143 ed.move_to_element(element).move_by_offse ...

Delete items within the first 10 minutes of shutting it down

Is there a way to temporarily remove a newsletter element for 10 minutes after closing it on a webpage? The idea is that once the panel is closed, it should stay hidden even if the page is refreshed within that timeframe. I was considering using local stor ...

The total height of an HTML element, which takes into account the margin of the element itself

Is there a way to accurately calculate the height of an element including margins, even when dealing with child elements that have larger margins than their parents? HTMLElement.offsetHeight provides the height excluding margin, while this function from ...

Tips for accessing the @keyframes selector and extracting the value from it

In my CSS code, I have a shape element with an animation that spins infinitely for 50 seconds. #shape { -webkit-animation: spin 50s infinite linear; } @-webkit-keyframes spin { 0% { transform: rotateY(0); } 100% { transform: rotateY(-360deg ...

Persistently Undefined Angular Attribute

I have been trying to dynamically bind a CSS class using an AngularJS function. While the functionality is working properly, I keep encountering numerous errors in the browser console. Can anyone offer assistance with this issue? I have included my code an ...

Unusual behavior exhibited by the Equals method

As per the insight provided in this response , .Net seems to compare value types either through reflection or bitwise operations. However, upon analyzing the code snippet below, it appears that it defies both methods simultaneously. //Bitwise test //if . ...

What are the steps to add SVG effects to an image or div element?

Embarking on my first venture into using SVG graphics has left me feeling a bit bewildered. Despite extensive research, I have yet to stumble upon the answer to my current quandary. The objective at hand is to transform an image, assuming that the source ...

Creating a customizable GridView with interactive controls is simple and effective

Is it possible to create editable gridviews with dynamic controls? An example of this can be seen in the image below. When the page loads, a gridview is displayed with just one row (excluding the header). This row includes two dropdownlists, two textboxes ...

The scroll-to-top arrow remains concealed when the height of the html and body elements is set to 100

I recently added a scroll-to-top arrow using Jquery, and it's functioning flawlessly. However, I encountered an issue when I set body and html to a height of 100%, as it mysteriously disappears. View this fiddle for reference The HTML structure is a ...

Trouble with jQuery: Background color fade in/fade out effects not functioning

Issue with changing background color during FadeIn and FadeOut effect. Whenever I click on the "whatup" link, my button should blink with alternating red and white colors. Below is the HTML code: <a id="blkwhatsup" href="#" >whatup</a> <in ...

How to use JQuery to retrieve multiple background image URLs from CSS styling

Initially, here is the CSS code that I am working with: background-image: url(/style_elements/img/first.png), url(/style_elements/img/second.png); I am trying to specifically target the second background image URL using jQuery: var item_img_url = item_i ...

Boss declares, "Display the iFrame with no borders visible."

Good day to everyone, I am currently dealing with an issue on the page: It seems to be working perfectly in all of my browsers except for Internet Explorer. Since I don't have IE, I'm having trouble troubleshooting this. My boss mentioned somet ...

Convert the dollar values in the dictionary to floating point values using Python and Selenium

I have collected data from 3 different sources and each has a unique value associated with it. I am looking to reduce these values by half before processing them through Venmo for a transaction. However, I am struggling to find an efficient way to divide t ...

Webpack2 now transforms sass/scss files into JavaScript rather than CSS during compilation

I've created a webpack script to compile all .scss files into one css file. I decided to use webpack instead of gulp or grunt for simplicity, as it can be configured in a single file. However, I am encountering an issue where scss files are being com ...

The Read method of the custom JsonConverter<DateTime> in System.Text.Json is not getting utilized when using the Deserialize method

I've encountered an issue with custom datetime formats in System.Text.Json. A custom converter I created was working fine in my API project, but when I tried using the same class in my client, the .Deserialize() methods wouldn't call .Read() on ...

Increasing the level of CSS list counters

HTML <ol> <li>item1 <ol> <li>item2</li> </ol> </li> <li>item1 <ol> <li>item2</li> <li>item3</li> </ol> </li> </ol> SC ...

Issue with Sass @use failing to load partial

I'm currently facing an issue while trying to import a sass partial called _variables.scss into my main stylesheet named global.scss. Every time I compile the sass code, I encounter the following error message: Error: Undefined variable. Here is the ...

Update the scrollspy navigation in a div with overflow by toggling the active class

Struggling to implement a navigation menu within a self-scrolling div using html/css/jquery. Looking for the menu items to toggle the active class when in view or at the top of the scrolling div. I'm essentially trying to achieve something like this ...

Certain data points are empty in the AJAX request to the ASP.Net Core controller

I'm having difficulty passing an object through a form to my controller using an AJAX call. Below is the object structure, where most values return null or 0 except for AuctionId: public class BidModel { [JsonProperty("BudID")] public string ...

Implementing Clockwise Padding with React Material-UI

Can Mui Box utilize shorthand properties for padding in a clockwise syntax? Unfortunately, this method does not work and results in a syntax error. <Box padding = {2 1 1 2}/> ...