Example usage for org.openqa.selenium.interactions Actions click

List of usage examples for org.openqa.selenium.interactions Actions click

Introduction

In this page you can find the example usage for org.openqa.selenium.interactions Actions click.

Prototype

public Actions click() 

Source Link

Document

Clicks at the current mouse location.

Usage

From source file:renascere.Renascere.java

License:Open Source License

/**
 * @Description Method that send an ACTION to a selected object
 */// w w  w  . ja  v a  2s  .c  o m
public static void performAction(tAction uiAction, String sValue, WebDriver driver, WebElement wElement) {
    try {
        Actions actions = new Actions(driver);
        actions.moveToElement(wElement);
        actions.click();
        pauseExecution(Global.fTimeQSecond);
        switch (uiAction) {
        case ENTER:
            actions.sendKeys(sValue);
            actions.build().perform();
            break;
        case SELECT:
            actions.sendKeys(sValue);
            actions.build().perform();
            pauseExecution(Global.fTimeQSecond);
            actions.sendKeys(Keys.ENTER);
            actions.build().perform();
            break;
        case CHOOSE:
            actions.sendKeys(sValue);
            actions.sendKeys(Keys.ENTER);
            actions.build().perform();
            pauseExecution(Global.fTimeQSecond);
            break;
        default:
            break;
        }
        return;
    } catch (Exception e) {
        frmError("performing action " + uiAction + " with: " + sValue, e.getMessage(), severity.HIGH);
    }
}

From source file:suppliers.pageobject.PageLogin.java

public void clickLoginButton() {
    Actions act = new Actions(driver);
    act.moveToElement(loginbtn);
    act.click().perform();
}