Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Selenium WebDriver - Double Click On Button Using Actions Class

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 922
    Comment on it

    Here, we discuss that how to double click on a button in Selenium WebDriver. In this, Actions Class helps to double click on any element or button.

     

    Also, we need to import:

     

    'import org.openqa.selenium.interactions.Actions'

     

     

    Steps to be automated:

    • Launch the browser
    • Open your site
    • Find the element on which you have to double click
    • Double click on that element

     

    WebDriver Code goes as below:

     

    import java.util.concurrent.TimeUnit;
    
    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 DoubleClick {
    
    	public static void main(String[] args) {
    
    		
            WebDriver driver = new FirefoxDriver();
    		
            driver.get("http://only-testing-blog.blogspot.in/2014/09/selectable.html");
            
            
    		driver.manage().timeouts().implicitlyWait(20L, TimeUnit.SECONDS);
    		driver.manage().window().maximize();
    		
    		
    		WebElement dblclk = driver.findElement(By.xpath(".//*[@id='post-body-7297556448793668582']/div[1]/button"));
    		
    		Actions action1 = new Actions(driver).doubleClick(dblclk);
    		action1.build().perform();
    		
    	}
    
    }

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: