Having trouble clicking on SubMenu with selenium web driver

Currently, I am looking into automating a UI application. In this application, there is a menu that displays sub-menus upon hovering the mouse over it. However, I am facing an issue where I am unable to click on the items within the sub-menu.

Here is the HTML code snippet:

<table class="mnuAdmin_2" id="mnuAdmin" border="0" cellspacing="0" cellpadding="0">
    <tbody>
        <tr>    
            <td id="mnuAdminn0" 
                onmouseover="Menu_HoverStatic(this)" 
                 ...

I have attempted two solutions:

  1. var element = driverIE.FindElement(By.LinkText("Administration")); Actions action = new Actions(driverIE);

      action.MoveToElement(element).Build().Perform();
       driverIE.FindElement(By.LinkText("Test2")).Click();
    

Answer №1

Consider the following steps:

action.MoveToElement(element).Perform();

Thread.sleep(5000L);

driverIE.FindElement(By.LinkText("Test2")).Click();

Allow for a delay before clicking on "Test2" to ensure that the sub menu has enough time to open.

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

Utilizing Bootstrap to create a row of four columns

I am utilizing Bootstrap 4.5.1 to showcase 4 columns, arranged in a row. Here is how my 4 columns are currently displayed: View I would like these 4 columns to be aligned in a single row without wrapping. Below is the code snippet for achieving this: ...

The HTML video controls in Safari take precedence over the window.name attribute

When using Safari 8.0.5, the controls attribute for the video element will change the value of window.name to "webkitendfullscreen". This is significant because I rely on using window.name to store client-side data in Safari's private mode, where loca ...

Limit a div to only accept a specific stylesheet

Currently, I am immersed in a project that involves HTML5, MVC 4, CSS 3, JQuery, and LINQ. We have meticulously designed styles for various ui, li, and other html controls within the project. However, I now face the challenge of integrating a JQ Grid (htt ...

Tips for implementing secure password validation and confirmation in HTML 5 forms

I am utilizing a script that mandates users to input a password with a capital letter, lowercase letter, and number. <input title="Password must contain at least 6 characters, including UPPER/lowercase and numbers" type="password" required pattern="( ...

Discover every item that begins with 'button-'

Currently, I am utilizing Selenium to retrieve all ID elements that begin with "button-". My initial approach involved using regex to locate the "button-" but unfortunately, I encountered an error message stating that TypeError: Object of type 'SRE_Pa ...

How to customize Material UI Autocomplete options background color

Is there a way to change the background color of the dropdown options in my Material UI Autocomplete component? I've checked out some resources, but they only explain how to use the renderOption prop to modify the option text itself, resulting in a a ...

The Selector object cannot be serialized into JSON format

Currently, I'm facing the challenge of scraping a dynamic website which requires the use of Selenium. The specific links that I'm interested in scraping only become visible when clicked on. These links are generated by jQuery, and there is no hr ...

Obtaining a specific value based on conditions from a table with the help of Selenium WebDriver using V

Currently, I am working on a program utilizing Selenium on Excel VBA to extract the daily portfolio report. The report typically consists of a table structured as shown in the following image: https://i.sstatic.net/P3INX.jpg In this process, I utilize the ...

Tips for dividing echo output from PHP into two separate divs using jQuery AJAX

I am trying to display two different echoes from PHP in separate divs within my AJAX success function. $.ajax({ url: 'counter.php', type: 'POST', data: { some_data:some_data ...

Jquery not functioning properly for show and hide feature

I'm new to using Jquery and JqueryUI. I have a div named front, which I want to initially display on window load and then hide it by sliding after a delay of 5500 milliseconds. However, I'm encountering errors in the jquery.min.js file. The HTML ...

The drop-down list was designed with a main button to activate it, but for some reason it is not functioning properly. Despite numerous attempts, the list simply will not display as intended

<html> <body> <button onclick="toggle()" class="nm" > main</button> <div class="cntnr" style="display : none;"> <ul class="cnkid"> <li class="cnkid"><a class="cnkid" ...

Center JQuery within the current screen

My implementation of Jquery dialog is as follows: <body> <div id="comments_dialog"> Insert a comment <form> <input type="text" id="search" name="q"> </form> </div> .... </body> dialog = $( "#com ...

Using jQuery to choose options and change the background color

Hey there, I have a select box below: <select id="events"> <option value="1" style="background-color:green;">Event 1</option> <option value="2" style="background-color:yellow;">Event 2</option> <option value="3 ...

PHP/CSS: Backgrounds for DIVs have been implemented, but they appear to be transparent

Update: Check out the link for some old photos here: I have a PHP file where I am creating divs with images as backgrounds using the code below (within a while-loop): echo ' <div class="pic" style="background:url('.$directory.'/'.$ ...

Having difficulty adjusting the text to match the image alignment

Having trouble aligning the text tag inside the H1 above the image. It keeps appearing in the wrong place, either on the left or right. I've tried including the h1 inside the container, but it just disappears. <!doctype html> <html> <h ...

Creating an Editor for Input Text Field in HTML: A Step-by-Step Guide

In the vast landscape of JS libraries that can achieve this function, like Trumbowyg and more. However, prior to my rails project displaying that slim version, I need to ensure JavaScript is properly escaped! Therefore, I need to create an editor using o ...

Perfectly aligning the Update Progress Animation in real-time

I am currently utilizing the Ajax UpdateProgress with a loading gif attached. The issue I am facing is how to ensure that the loading.gif always appears in the center of the screen, even if the user is at the very top or bottom of the page. Is there a meth ...

The vertical tabs in JQueryUI lost their functionality when a few seemingly unrelated CSS styles were added

Check out the JsFiddle demo here I embarked on a mission to craft JQueryUI Vertical tabs by following the guidance provided in this example. The source code within the aforementioned link contains specific CSS styles: .ui-tabs-vertical { width: 55em; } ...

Generating dynamic DOM elements using AngularJS can cause issues with the proper functionality of the Jquery .tab() method

My goal is to dynamically generate a list of elements - the first loop is dedicated to listing tabs for the menu, while the second loop involves the div with the tab contents. When I write it statically, everything works perfectly. However, the dynamic app ...

What is the reason for always including "http://" when using the get() method with FirefoxDriver()?

Is it necessary to include http:// in the get() method of FirefoxDriver()? For example, when using driver.get("http://www.example.com"); If I don't include http, an error occurs. Why is http:// required in the get() method? public class OpenBrowser{ ...