开发者

Mouse Hover on WebElement using Selenium 2 in Java [duplicate]

开发者 https://www.devze.com 2023-03-10 19:24 出处:网络
This question already has answers here:开发者_运维技巧 Closed 10 years ago. Possible Duplicate: Is there a proved mouseOver workaround for FirefoxDriver in Selenium2?
This question already has answers here: 开发者_运维技巧 Closed 10 years ago.

Possible Duplicate:

Is there a proved mouseOver workaround for FirefoxDriver in Selenium2?

I want to be able to mouse hover a WebElement with the Java Selenium2 API. Is that possible? I am using the current beta 3.


This will help you:

WebElement elems=driver.findElement(By.linkText("Custom Development"));//Menu Item
WebElement elems1=driver.findElement(By.xpath("//li[@id='item-465']/a"));//Menu
Actions builder = new Actions(driver); 
Actions hoverOverRegistrar = builder.moveToElement(elems1);
hoverOverRegistrar.perform();
elems.click();//at last Menu Item Click
0

精彩评论

暂无评论...
验证码 换一张
取 消