List of usage examples for org.openqa.selenium.interactions Actions moveToElement
public Actions moveToElement(WebElement target)
From source file:com.chtr.tmoauto.webui.CommonFunctions.java
License:Open Source License
@Override public void moveToAndClick(String locator) { log.debug("Moving to and Clicking: " + locator); Actions action = new Actions(webDriver); action.moveToElement(findElement(locator)).click().build().perform(); }
From source file:com.chtr.tmoauto.webui.CommonFunctions.java
License:Open Source License
@Override public void moveToAndClick(WebElement locator) { log.debug("Moving to and Clicking: " + locator); Actions action = new Actions(webDriver); action.moveToElement(locator).click().build().perform(); }
From source file:com.cisco.dbds.utils.primewidgets.primewidgetsStepDef.java
License:Open Source License
@Given("^Hover over the tooltip icon and verify tooltip content$") public void hover_over_tooltip_icon_and_verify_content(DataTable table) { for (String label : table.topCells()) { try {//from ww w .j a v a2s.c om List<Map<String, String>> map = table.asMaps(String.class, String.class); try { Actions action = new Actions(SeleniumUtilities.getDriver()); action.moveToElement( SeleniumUtilities.findElement(Identifier.XPATH, String.format(IMAGE_ICON, label))) .perform(); } catch (WebDriverException | NoSuchMethodException | SecurityException | ClassNotFoundException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { Assert.assertTrue("Page Object not found on VCS Console", false); } SeleniumUtilities.wait(2); String actual_text = primewuipf.TOOLTIP_RIGHT_WE_XPATH.getText().trim(); actual_text = actual_text.replaceAll("\\r|\\n", ""); actual_text = actual_text.trim(); //System.out.println(actual_text); Assert.assertTrue("Actual tooltip " + actual_text + "does not match with expected tooltip " + map.get(0).get(label), actual_text.equals(map.get(0).get(label))); SeleniumUtilities.wait(4); } catch (WebDriverException e) { Assert.assertTrue("Page Object TOOLTIP_RIGHT_WE_XPATH not found on VCS Console", false); } } }
From source file:com.cisco.dbds.utils.primewidgets.primewidgetsStepDef.java
License:Open Source License
@Given("^Hover over the tooltip icon and verify tooltip content \"(.*?)\" for field \"(.*?)\"$") public void hover_over_tooltip_icon_and_verify_content(String tooltip, String label) { //for (String label : table.topCells()) //{//from w w w . j a v a 2s. c o m try { // List<Map<String, String>> map = table // .asMaps(String.class, String.class); try { Actions action = new Actions(SeleniumUtilities.getDriver()); action.moveToElement( SeleniumUtilities.findElement(Identifier.XPATH, String.format(IMAGE_ICON, label))) .perform(); } catch (WebDriverException | NoSuchMethodException | SecurityException | ClassNotFoundException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { Assert.assertTrue("Page Object not found on VCS Console", false); } SeleniumUtilities.wait(2); String actual_text = primewuipf.TOOLTIP_RIGHT_WE_XPATH.getText().trim(); actual_text = actual_text.replaceAll("\\r|\\n", ""); actual_text = actual_text.trim(); //System.out.println(actual_text); Assert.assertTrue("Actual tooltip " + actual_text + "does not match with expected tooltip " + tooltip, actual_text.equals(tooltip)); SeleniumUtilities.wait(4); } catch (WebDriverException e) { Assert.assertTrue("Page Object TOOLTIP_RIGHT_WE_XPATH not found on VCS Console", false); } // } }
From source file:com.cisco.dbds.utils.primewidgets.primewidgetsStepDef.java
License:Open Source License
@Given("^Hover over popover icon and verify PopOver title and content \"(.*?)\"$") public void hover_over_popover_icon_and_verify_popover_title_content(String exp_popovercontent, DataTable table) {//from ww w .j a va2s . co m LogHandler.info("hover_over_popover_icon_and_verify_popover_title_content(DataTable table)"); List<Map<String, String>> widgetlst = table.asMaps(String.class, String.class); String popover_content; for (Map<String, String> widgetvalue : widgetlst) { try { try { Actions action = new Actions(SeleniumUtilities.getDriver()); action.moveToElement(SeleniumUtilities.findElement(Identifier.XPATH, String.format(IMAGE_ICON, widgetvalue.get("Field")))).perform(); } catch (WebDriverException | NoSuchMethodException | SecurityException | ClassNotFoundException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { Assert.assertTrue("Page Object not found on VCS Console", false); } Assert.assertTrue( "Actual popover title " + primewuipf.POPOVER_TITLE_WE_XPATH.getText().trim() + "does not match expected popover title " + widgetvalue.get("PopOverTitle"), primewuipf.POPOVER_TITLE_WE_XPATH.getText().trim().equals(widgetvalue.get("PopOverTitle"))); LogHandler.info("Verified popover title " + widgetvalue.get("PopOverTitle") + "for field" + widgetvalue.get("Field")); popover_content = primewuipf.POPOVER_CONTENT_WE_XPATH.getText().trim(); popover_content = popover_content.replaceAll("\\r|\\n", ""); popover_content = popover_content.trim(); Assert.assertTrue("Actual popover content " + popover_content + "does not match expected popover content " + exp_popovercontent, popover_content.equals(exp_popovercontent)); } catch (WebDriverException e) { Assert.assertTrue("Page Object POPOVER_TITLE_WE_XPATH not found on VCS Console", false); } } }
From source file:com.cisco.dbds.utils.primewidgets.primewidgetsStepDef.java
License:Open Source License
@Given("^Hover over popover icon and verify PopOver title and content$") public void hover_over_popover_icon_and_verify_popover_title_content(DataTable table) { LogHandler.info("hover_over_popover_icon_and_verify_popover_title_content(DataTable table)"); List<Map<String, String>> widgetlst = table.asMaps(String.class, String.class); String popover_content;/*from w ww.ja v a2s . co m*/ for (Map<String, String> widgetvalue : widgetlst) { try { try { Actions action = new Actions(SeleniumUtilities.getDriver()); action.moveToElement(SeleniumUtilities.findElement(Identifier.XPATH, String.format(IMAGE_ICON, widgetvalue.get("Field")))).perform(); } catch (WebDriverException | NoSuchMethodException | SecurityException | ClassNotFoundException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { Assert.assertTrue("Page Object not found on VCS Console", false); } Assert.assertTrue( "Actual popover title " + primewuipf.POPOVER_TITLE_WE_XPATH.getText().trim() + "does not match expected popover title " + widgetvalue.get("PopOverTitle"), primewuipf.POPOVER_TITLE_WE_XPATH.getText().trim().equals(widgetvalue.get("PopOverTitle"))); LogHandler.info("Verified popover title " + widgetvalue.get("PopOverTitle") + "for field" + widgetvalue.get("Field")); popover_content = primewuipf.POPOVER_CONTENT_WE_XPATH.getText().trim(); popover_content = popover_content.replaceAll("\\r|\\n", ""); popover_content = popover_content.trim(); Assert.assertTrue( "Actual popover content " + popover_content + "does not match expected popover content " + widgetvalue.get("PopOverContent"), popover_content.equals(widgetvalue.get("PopOverContent"))); LogHandler.info("Verified popover content " + widgetvalue.get("PopOverContent") + "for field" + widgetvalue.get("Field")); } catch (WebDriverException e) { Assert.assertTrue("Page Object POPOVER_TITLE_WE_XPATH not found on VCS Console", false); } } }
From source file:com.cisco.dbds.utils.selenium.SeleniumUtilities.java
License:Open Source License
/** * Move to a given WebElement.//from w w w. j a va 2 s . com * * @param element * the element */ public static void moveToElement(WebElement element) { Actions builder = new Actions(driver); builder.moveToElement(element).build().perform(); }
From source file:com.cloudbees.workflow.ui.AbstractPhantomJSTest.java
License:Open Source License
protected void moveMouseToElement(WebDriver webdriver, WebElement element) { Actions actions = new Actions(webdriver); actions.moveToElement(element).build().perform(); }
From source file:com.cloudbees.workflow.ui.AbstractPhantomJSTest.java
License:Open Source License
protected void clickOnElement(WebDriver webdriver, WebElement element) { Actions actions = new Actions(webdriver); actions.moveToElement(element).click().perform(); }
From source file:com.cloudbees.workflow.ui.AbstractPhantomJSTest.java
License:Open Source License
protected void moveMouseOffElement(WebDriver webdriver) { Actions actions = new Actions(webdriver); actions.moveToElement(webdriver.findElement(By.cssSelector("html"))).build().perform(); }