List of usage examples for org.openqa.selenium.interactions Actions Actions
public Actions(WebDriver driver)
From source file:br.gov.frameworkdemoiselle.behave.runner.webdriver.ui.WebButton.java
License:Open Source License
@Override public void mouseOver() { waitElement(0);//from w ww . ja va2s. c o m // mouse over Actions actions = new Actions(getDriver()); actions.moveToElement(getElements().get(0)).build().perform(); }
From source file:br.gov.frameworkdemoiselle.behave.runner.webdriver.ui.WebLink.java
License:Open Source License
public void mouseOver() { waitElement(0);//from w ww . j a va 2s . co m // mouse over Actions actions = new Actions(getDriver()); actions.moveToElement(getElements().get(0)).build().perform(); }
From source file:browsermator.com.DragAndDropAction.java
@Override public void RunAction(WebDriver driver) { try {//from w ww. j ava 2s . c om WebElement dragElement = driver.findElement(By.xpath(this.Variable1)); WebElement dropElement = driver.findElement(By.xpath(this.Variable2)); Actions actions = new Actions(driver); actions.dragAndDrop(dragElement, dropElement).perform(); this.Pass = true; } catch (Exception e) { this.Pass = false; System.out.println("Exception: " + e); } }
From source file:browsermator.com.RightClickAction.java
@Override public void RunAction(WebDriver driver) { Actions actions = new Actions(driver); actions.contextClick().build().perform(); }
From source file:ca.nrc.cadc.search.integration.SearchResultsPage.java
License:Open Source License
void includeHiddenColumn(final String uType) throws Exception { click(gridContainer.findElement(CHANGE_COLUMNS_BY)); waitForElementVisible(CHANGE_COLUMNS_POPUP_BY); waitForElementPresent(CHANGE_COLUMNS_AVAILABLE_COLUMNS_LIST_BY); final WebElement changeColumnsPopupElement = find(CHANGE_COLUMNS_POPUP_BY); final WebElement availableColumnsListElement = changeColumnsPopupElement .findElement(CHANGE_COLUMNS_AVAILABLE_COLUMNS_LIST_BY); final WebElement selectedColumnsListElement = changeColumnsPopupElement .findElement(CHANGE_COLUMNS_SELECTED_COLUMNS_LIST_BY); final String listItemID = "ITEM_" + uType; final String listItemSelector = "#" + listItemID; final WebElement listItem = availableColumnsListElement.findElement(By.id(listItemID)); scrollIntoView(listItem);//from w w w .j a v a2s . com waitForElementVisible(listItem); if (listItem == null) { throw new RuntimeException("Unable to locate list item in change columns for " + listItemSelector); } else { // check that the drag-and-drop changed the ordinal of the column (new Actions(driver)).dragAndDrop(listItem, selectedColumnsListElement).perform(); waitForElementVisible(selectedColumnsListElement.findElement(By.id(listItemID))); click(changeColumnsPopupElement.findElement(By.id("column_manager_close"))); } }
From source file:ca.nrc.cadc.web.selenium.AbstractTestWebPage.java
License:Open Source License
public void click(final WebElement elem) throws Exception { final Actions action = new Actions(driver); scrollIntoView(elem);//from w w w . java 2s . c o m waitForElementClickable(elem); action.moveToElement(elem).click(elem).build().perform(); }
From source file:ca.nrc.cadc.web.selenium.AbstractTestWebPage.java
License:Open Source License
/** * Issue a drag and drop command.//from w w w .j a v a 2 s.c o m * * @param source The source element. * @param destination The to (target) element to drop into. * @throws Exception For any test execution errors. */ protected void dragAndDrop(final By source, final By destination) throws Exception { (new Actions(driver)).dragAndDrop(find(source), find(destination)).perform(); }
From source file:ca.nrc.cadc.web.selenium.AbstractTestWebPage.java
License:Open Source License
protected void hover(final WebElement element) throws Exception { final Actions action = new Actions(driver); action.moveToElement(element).build().perform(); }
From source file:ca.nrc.cadc.web.selenium.AbstractWebApplicationIntegrationTest.java
License:Open Source License
/** * Issue a drag and drop command.//from ww w . ja v a2 s .com * * @param source The source element. * @param destination The to (target) element to drop into. * @throws Exception For any test execution errors. */ public void dragAndDrop(final By source, final By destination) throws Exception { (new Actions(driver)).dragAndDrop(find(source), find(destination)).perform(); }
From source file:ca.nrc.cadc.web.selenium.AbstractWebApplicationIntegrationTest.java
License:Open Source License
public void hover(final WebElement element) throws Exception { final Actions action = new Actions(driver); action.moveToElement(element).click().build().perform(); }