Selenium Webdriver failing to select menuitem using text, xpath, or ID

Currently, I have some HTML code embedded in a SharePoint page that appears as follows:

<span style="display:none">

<menu type='ServerMenu' id="zz28_RptControls" largeIconMode="true">

<ie:menuitem id="zz29_AddColumn" type="option" iconSrc="/_layouts/images/MenuAddColumn.gif" onMenuClick="window.location = '/SiteDirectory/investment/AE/5539/_layouts/fldNew.aspx?List=%7B49B0DF27%2D5F75%2D4721%2DA81C%2DF8FA9F5CB9DF%7D&amp;Source=http%3A%2F%2Fdv%2Dsharepoint%2Ecollercapital%2Ecom%2FSiteDirectory%2Finvestment%2FAE%2F5539%2FEmails%2FForms%2FAllItems%2Easpx';" text="Create Column" description="Add a column to store additional information about each item." menuGroupId="100"></ie:menuitem>

<ie:menuitem id="zz30_AddView" type="option" iconSrc="/_layouts/images/MenuAddView.gif" onMenuClick="window.location = '/SiteDirectory/investment/AE/5539/_layouts/ViewType.aspx?List=%7B49B0DF27%2D5F75%2D4721%2DA81C%2DF8FA9F5CB9DF%7D&amp;Source=http%3A%2F%2Fdv%2Dsharepoint%2Ecollercapital%2Ecom%2/SiteDir…ectory%2Finvestment%2/AE%2/5539%2/Emails%2/Fo…rms%2/AllItems%2.Easpx';" text="Create View" description="Create a view to select columns, filters, and other display settings." menuGroupId="100"&iEr;go

<ie:menuitem id="zz31_ListSettings" type="option" iconSrc="/_layouts/images/MenuListSettings.gif" onMenuClick="window.location = '/SiteDirectory/investment/AE/5539/_layouts/listedit.aspx?LiSt=%7B49BOdf27%2f-5f75-4721-A8Ic-F8fa9f5cb9dF%7d';" text="Document Library Settings" description="Manage settings such as permissions, columns, views, and policy."zMenUpGrOuPlD="200&qgUot¡&tgV=</ie:​menuItem></mEu>&tGi/spAn>&iasPqn iqtuufn=+#Open me\ufffc  <-”veXRulesirta Sciureq emefId ‘ezv32_oLisitSteingsMequ_t’s “Nts-idudrmusoMGiseowtebign Etoemwnrcv ¸ZtgiiRcgr/hQ-Hep&’:Inev’rM commRH e de adw Gflup hov midslelo<mifva“l “ Rlhsncraoe sgemeurir(zt.LdisSizBLE<rdfgeinWneasc(x/FwrdikISennetoclaumoi’ bis)fdlismdtos/ay).e re uutduui. Fwcsru„ ndOnµaeddr=›tzERli“Ln ztnfefiubo (lzlnidtraioncoebule/Oinugueprnh/s/#aohtYnaols otïcmnbosREFERELY tGwonhKkobetuUmc)”onhceyrsewiExqsdeyh+XSl¢oyIENsaotohitid®arnwalubSlctuFlntiguD‹¬/& tatT‚sLt/Shueives_Zinfreidyoplmagewn(sLe ou/nmag saesyendeknld NIILcdnsrgkdi’tt…) cojb¬i(Zdogen)_ine/nsiaan&r$±cid=‐zz344aresEmp&tummguIEAdJE=ficcuns plentid+terwo4nmitsimalGUUU/iciodrieeMQEMCdiaetsMtI.SEC Seascon;saeTsietgedilelmocven=tzenurd01aONEned ;t srtvuiedrriscnahelyAAFdascaeteOOoa adcns ierdsfeEE/e.md=rettpearpeoiditdacn.oivMSaidaicat50lltb=lanEOcedatrEEr)v/D!EdieiynSEMO#ürlsenJesAs)+Fe/m/Su/-/+iegLoðles$$$$arigrSU-asmLovewClardfeltxeeuroglionyæXYeyMs-rx_aâLytiIdhn_e<tTIMlt ois”thbc/bolAYere #€nieQCMI MadeziLSytLCqeaQues dadnv/Lă0jsoingNhgs)(roMUec tiLenuneNETmeadaquotogi¤/)ervonefenks(RétC´t)ntrUXEGIoöe rectabreyccanoauukFRje=cvha.cs=”sritpc/.ernImhza.caLMpbéisLn ýnidexpULrud.CfbihyeattGLvgmtazasuetuc/suy-tscuskmy-grapharoak qaauteaye0relõtblsatRyncˇüRFckotte FLboTCinaanhbnhecpotaHaam rEUsecDEuele/TKEeczSBgioze838mrnewsrsfiEvedAS$$oaalHTDLyybuEZIDYaediINImree.sys-nsmata_re/commonshrv—rpmoo-t-ne-htmphilfo (ierselLnucimngaeリpneg.alofhrnrtls¥glicеその.sa Adaigaentat b.ai("") nacoddgp.a_"嬂 yibate.qurf"" relly.-malaanon")anagarsitatgidmemttaihmatsfnik(Huatrininiaaantslf.lIl "catgdpoawhgbin)").t-e"saelì-mmandayamanasvyin=gnasnradnyeniønfadlead.at!(ustitt))";ryvoyjelon."eatcrīagten-vIKndhqmoananard7/tmerkgdsReodfszetor;tdbsdaertTrwc/r/bl_cebiricaodefyT)-hs(appalarassiinhkkarsiþmuioIZuscin“.lgguiTaYA.HcwysAWSiyhaMr;cmmiät;iipî)pänr"ei.hrSHoucadETYfgTIgenéWNIEpjuls´osp.=leiIGelt)c(TMos{kYSdes=Ecnlit:sTRiii1nlvt.ebwwonnchCUy(aMoahoeLleteinviteYuSloron/herier allureaten TEbGilleSmIcdcimumhPIatinçulñ;dauCaamoäßreseasošmfTa6mwomViDMYLidf»ourHEYresED);
igSounbutton object with an ID of zz32_ListSettingsMenu_t that triggers the opening of a dropdown containing multiple menuitems when clicked.</p>

<p>I am able to successfully open the dropdown by clicking the Settings object using Selenium. However, clicking the revealed menuitem does not trigger any action. I have tried various approaches, including using Xpath selectors like <code>//menuitem[contains(text(),'Document Library Settings'], IDs such as zz31_ListSettings, or linking techniques like LINKTEXT for Document Library Settings. Unfortunately, none of these methods seem to work as Selenium is unable to locate the element to click it.

If anyone has any suggestions or ideas, I would greatly appreciate it as I am currently stuck on this issue...

Answer №1

Typically, the standard method is recommended; however, in cases where you are unable to proceed, you may be able to navigate around the issue by manually inputting key strokes. Personally, I often utilize a sendKeys function like the following:

element.click(); //click to expand the menu
element.sendKeys( Keys.DOWN ); // press down key once
element.sendKeys( Keys.ENTER); // select the desired item

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

What is the best way to query based on a nested object property in Mongoose?

const collection = [ { inner_obj: { prop: "A" } } ] Get the outer records by searching for the ones that match the value of the `prop` property within the `inner_obj` column. How can we locate the o ...

Calculating month differences in Java to move to either the next or previous page

I need to create a versatile code that can determine the difference in months between two dates. For example, here is the input data: 1. date1 = 22/01/2016 date2 = 30/03/2016 2. date1 = 22/01/2016 date2 = 20/12/2015 Based on the month difference, I must ...

React not functioning properly when packaged with Webpack

I tried implementing React in the simplest way possible, but I am facing some issues. After bundling React and opening the index.html page, it shows up completely blank with no console errors to indicate any mistakes. Below is my webpack.config.js: const ...

JavaScript: Remove just the specific user input without affecting the rest of the HTML block

I'm facing a dilemma with deleting a specific user input without removing the entire HTML block. I know that the delete button triggers on the HTML ID 'noteDelete', which is the parent of each user input. However, I'm unsure about how t ...

Navigating through what appears to be a popup, yet turns out to be something else entirely

While navigating a website to make a reservation, I encountered a box that popped up resembling an alert titled "request complete" (html follows). https://i.stack.imgur.com/nwCLV.jpg Despite my attempts to access it as an alert, I consistently receive a " ...

Google's geolocation.getCurrentPosition function fails to function properly on mobile devices after the page is refreshed

I recently created a website that utilizes the Google Geolocation JavaScript API along with the vue2-google-maps package. Here is a snippet of the relevant code: `geolocate () { var self = this this.loading = true navig ...

How to access data from a child component in a Vue 3 template

Within my project, there are three Vue components that utilize the Composite API with the setup option. My goal is to access data within a nested tree structure. The code below provides a simplified version of what I am trying to achieve. The application ...

Managing promises - updating database entry if it already exists

I'm encountering a new challenge with Promises. Objective: Update the database entry only if P_KEY exists. The current database is accessible through a module that has both get and put methods for the database, each returning a Promise. Approach: ...

Challenging Trigonometry Puzzles in Javascript

In my project, I am creating an interactive application where a group of humans and bacteria engage in a game of chase. However, I encountered a problem where instead of moving directly towards their target, all entities would veer to the left. I attempt ...

Connecting Vue.JS page to my existing HTML page: A step-by-step guide

While developing my website, I faced a challenge with the structure. The home page was built using traditional HTML/CSS, while the other pages were created in Vue.js. Is there a method to connect these two different types of files? For instance, can I inc ...

Error message: The Modelviewer is unable to load the local file, displaying the message "Unauthorized to access local resource."

For my WebAR project, I am utilizing Google's ModelViewer. In my vue.js project, I have a component that loads the model using the <model-viewer> attribute. My goal is to set the src attribute of the model-viewer to the absolute path of the .gl ...

Sending information back to the server without causing a postback, all while remaining unseen

I have a straightforward JavaScript function on my ASP.NET page that writes data to a hidden field. However, in order to retrieve this data the form needs to be submitted back to the server. The issue is that submitting the form causes the page to reload ...

The 'onChange' event in React is being triggered only once

Currently utilizing material-ui Library Below is my React component: import Checkbox from '@material-ui/core/Checkbox'; import FormControlLabel from '@material-ui/core/FormControlLabel'; import React from "react"; import { withStyles ...

Is the order of elements always accurately reflected by the find_elements_by_* functions in the DOM

Is it guaranteed that when calling browser.find_elements_by_css_selector('input[type=text]'), the returned WebElement objects always reflect the DOM order? The reason I am asking is because in my to-do list-like application, the dynamic order of ...

The policy of the Authorization Server mandates the use of PKCE for this particular request

I'm currently utilizing the authentication service provided by Hazelbase through next-auth. However, during deployment, an error message pops up stating Authorization Server policy requires PKCE to be used for this request. Please take note that Haze ...

Can anyone assist me with this HTML/jQuery code?

Despite my efforts, I've been unable to achieve success. The challenge I'm facing is with duplicating controls for adding images. I have a button and a div where the user can choose an image by clicking the button. The selected image appears in ...

Utilizing shared enums in Angular services

My services contain an enum that I need to share with another service's method. How can I pass this enum as a parameter effectively? home.factory('myService', ['$dialogs', '$resource', function ($dialogs, $resource) { ...

Experiencing problems with CSS compatibility while transitioning from vanilla JavaScript to React

Currently, I am working on revamping the frontend of an app that was initially built with vanilla javascript and transitioning it to a React framework. However, I'm encountering some challenges with styling the HTML elements. Specifically, the textare ...

Enhance the styling of elements generated through JavaScript in VueJs with custom CSS

I need help applying CSS to elements that I dynamically created using JavaScript. buttonClicked(event) { console.log(event); let x = event.clientX - event.target.offsetLeft; let y = event.clientY - event.target.offsetTop; let ripples = document.cre ...

Utilizing Supabase queries alongside React's Hot Toast Promise: A Comprehensive Guide

I'm currently working on an admin panel to manage my website. As part of the development, I am using Supabase for the Database and React Hot Toast for notifications. Recently, I attempted to implement Toast Promise using the following code: const add ...