Nagarjuna Reddy
Nagarjuna Reddy

Reputation: 819

Not able to click on the drop down element

In our application when i mouse over a menu item, drop down appears. Where i want to select an item by clicking on it. Main Menu:Admin Sub menu: Manage Channels, Manage Users In selenium webdriver, i tried to click directly on Manage Channels by giving the xpath, linktext,partial link text.

But all says unable to locate element. i'm attaching image of the screen shot for reference
Please check it

driver.findElement(By.linkText("Manage Channels")).click(); driver.findElement(By.xpath("//li/a[contains(., \"Manage Channels\")]")).click(); driver.findElement(By.partialLinkText("Manage Channels"));

http://farm8.staticflickr.com/7454/9490144055_1f7da5eaf1_m.jpg

Upvotes: 1

Views: 3491

Answers (1)

Nagarjuna Reddy
Nagarjuna Reddy

Reputation: 819

I used the below code which finally solved my question.

       WebElement ManageChannels = driver.findElement(By.linkText("Admin"));
       Actions builder = new Actions(driver);
       Action mouseOverAdmin = builder.moveToElement(ManageChannels).build();
       mouseOverAdmin.perform();
       driver.findElement(By.linkText("Manage Channels")).click()

i managed to click on item in the drop down. thank you very much for the effort

Upvotes: 2

Related Questions