Tuesday, 8 August 2017

Code Example - Mouse Hover

package com.seleniumWebdriver;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.testng.annotations.Test;

/**
 * @Blog Name : Selenium Code Example
 * @author Deepak Gupta
 * @Created Date 8-08-2017
 *
 */
public class MouseHover extends SuperTestNG {

@Test
public void handleMouseHover() throws InterruptedException {

try {
driver.navigate().to("http://only-testing-blog.blogspot.in/2015/03/chart.html");
WebElement element = driver.findElement(By.linkText("Hover over me"));
Actions action = new Actions(driver);
action.moveToElement(element).build().perform();

Thread.sleep(2000);

} catch (Exception e) {
System.out.println("Expection is : " + e);
}
}

}

No comments:

Post a Comment

Code Example - File Download By Robot Class In Firefox Browser

Exported from Notepad++ package com . practiceCode ; import java . awt . AWTException ; import java . awt . Robot ; import j...