Tell me more ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

The website I am trying to automate can be navigated by using sitemap tree.Now in order to access the child nodes from selenium I wrote the following code:

IWebElement menu = driver.FindElement(By.LinkText("Setup"));
//Setup is the parent node
Actions mouseOver = new Actions(driver);
mouseOver.MoveToElement(menu).Build().Perform();
driver.FindElement(By.LinkText("Entities")).Click();
//Entities is the child node.

But webdriver throws an Element not found exception.

I am using Firefox for playing the test case.

share|improve this question
How is this question related to Software Testing? – devonps Apr 4 '12 at 10:19
2  
Based upon the information you have supplied I would suggest that there is no element that has the link test "Entities" on your page. You will need to give us more information if you want help, the website you are testing would be a good start. – Ardesco Apr 4 '12 at 11:23
Agreed. It is also possible that the actual link text is something like " Entities" or "Entities ". – user246 Apr 4 '12 at 12:58
Another potential issue... if the element does not exist on the page until you hover over the menu, are you sure that code is working? Do you see the "Entities" link appear visually after the line of code where you call mouseOver? – Sam Woods Apr 4 '12 at 23:31
I'm also facing the same problem. In my case, "Setup: is the Root Node and "Entities" is the Sub Node for Setup and both the Nodes are shown in View. Can Anyone help me to sort out the solution to select the node ENTITIES. Thanks in Advance. – user2871 Aug 6 '12 at 11:15

closed as not a real question by corsiKa Nov 5 '12 at 16:06

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.

1 Answer

As Ardesco and user246 have mentioned, without additional information it's not really possible to give you a thorough answer. In my experience with hover-over menu options, it helps to create a second WebElement for the child node, in your case, the "Entities" element.

To expand on what has already been mentioned, you may want to verify that the "Entities" link text is correct, or use an Xpath or CSS selector instead.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.