Can't able to select a specific list that I want in Selenium + C#

36 Views Asked by At

Actually, I wanted to select a specific list that I want inside a container. But I try to write with the code below but it is not reflecting:

Actions actions = new Actions(driver);

IWebElement mainMenu = driver.FindElement(By.XPath("//*[@id='requestItemSFHD-24']"));

actions.MoveToElement(mainMenu).Build().Perform();

actions.MoveToElement(mainMenu).Click();

Can anyone help me with this? Thanks.

enter image description here

1

There are 1 best solutions below

0
Kevin On BEST ANSWER
Actions actions = new Actions(driver);
IWebElement mainMenu = driver.FindElement(By.ClassName("requestItem-target"));
actions.MoveToElement(mainMenu).Build().Perform();
driver.FindElements(By.ClassName("requestItem-target")).ElementAt(1).Click();