Double Click on Element

package seleniumOperations;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;

public class DoubleClickOnElement
{
public static void main(String a[])
{


       WebDriver driver = new FirefoxDriver();
       String URL="http://selenium-code.blogspot.in/";
            driver.get(URL);

            // return type of findElement() method is WebElement
            WebElement element=driver.findElement(By.xpath(".//*[@id='Blog1']/div[1]/div/div/div/div/h3/a"));


            /*By Action Class, Build Simple or Complex Chain of events in Composite Way
            1.Ready to  Perform by build() method
            2.Test Perform Composite Action by Perform() method*/
         
            Actions action= new Actions(driver);
            action.doubleClick(element).build().perform();


}

}

Post a Comment

0 Comments