@Override public void doubleClickAt(String locator, String coordString) { WebElement webElement = getWebElement(locator); WrapsDriver wrapsDriver = (WrapsDriver) webElement; WebDriver webDriver = wrapsDriver.getWrappedDriver(); Actions actions = new Actions(webDriver); if (coordString.contains(",")) { String[] coords = coordString.split(","); int x = GetterUtil.getInteger(coords[0]); int y = GetterUtil.getInteger(coords[1]); actions.moveToElement(webElement, x, y); actions.doubleClick(); } else { actions.doubleClick(webElement); } Action action = actions.build(); action.perform(); }
@TargetBrowsers({BrowserType.GOOGLECHROME}) public void doTestUpdateOnAttributeWithCertainEventsChrome(String url) throws Exception { open(url); String value = getCurrentModelValue(); WebDriver d = getDriver(); Actions a = new Actions(d); WebElement outputDiv = findDomElement(By.id("output")); String eventName = "dblclick"; WebElement input = auraUITestingUtil.findElementAndTypeEventNameInIt(eventName); assertModelValue(value, "Value shouldn't be updated yet."); a.doubleClick(input).build().perform(); value = assertModelValue(eventName); assertDomEventSet(); eventName = "mousemove"; input = auraUITestingUtil.findElementAndTypeEventNameInIt(eventName); assertModelValue(value, "Value shouldn't be updated yet."); a.moveToElement(input).moveByOffset(0, 100).build().perform(); value = assertModelValue(eventName); assertDomEventSet(); eventName = "mouseout"; input = auraUITestingUtil.findElementAndTypeEventNameInIt(eventName); assertModelValue(value, "Value shouldn't be updated yet."); a.moveToElement(input).moveToElement(outputDiv).build().perform(); value = assertModelValue(eventName); assertDomEventSet(); eventName = "mouseover"; input = auraUITestingUtil.findElementAndTypeEventNameInIt(eventName); assertModelValue(value, "Value shouldn't be updated yet."); outputDiv.click(); a.moveToElement(input).build().perform(); value = assertModelValue(eventName); assertDomEventSet(); eventName = "mouseup"; input = auraUITestingUtil.findElementAndTypeEventNameInIt(eventName); assertModelValue(value, "Value shouldn't be updated yet."); input.click(); value = assertModelValue(eventName); assertDomEventSet(); eventName = "select"; input = auraUITestingUtil.findElementAndTypeEventNameInIt(eventName); assertModelValue(value, "Value shouldn't be updated yet."); a.doubleClick(input).build().perform(); value = assertModelValue(eventName); }
@Ignore @Test public void TestCase_005() throws Exception { LogGenerator.addLog(Level.INFO, "Starting Test Case_004"); driver.get("http://myitlabgrader.com/HTML5/SIMFrame.html"); // assertEquals("SIMs Demo", driver.getTitle()); synchronized (driver) { driver.wait(12000); } System.out.println("test1"); WebElement we = driver.findElement(By.cssSelector("#msword > img")); Actions action = new Actions(driver); action.doubleClick(we); action.perform(); synchronized (driver) { driver.wait(12000); } String name = (new Exception().getStackTrace()[0].getMethodName()); CaptureScreenshot.takeScreenshot(driver, name); synchronized (driver) { driver.wait(6000); } driver.findElement(By.cssSelector("span.ribbon-title.IDFileTab")).click(); driver .findElement(By.xpath("html/body/div/div/div[3]/div/div/div/div/div[3]/div/div/div[4]")) .click(); driver .findElement( By.xpath("/html/body/div/div/div[3]/div/div/div/div/div[3]/div/div[4]/div[3]/p[5]/img")) .click(); we = driver.findElementByXPath( "/html/body/div/div/div[6]/div/div[2]/div/div/div[3]/div/div[2]/div[8]/img"); action.doubleClick(we); action.perform(); }
public void doubleClick() { invoker.doJAction( "Double click on Element", () -> { getWebElement().getSize(); // for scroll to object Actions builder = new Actions(getDriver()); builder.doubleClick(getWebElement()).perform(); }); }
/** * Performs a double-click at the current mouse location. * * @return Parent instance */ public ParentPanel doubleClick() { getWebElement().getSize(); // for scroll to object logAction(this, getParentClassName(), "doubleClick"); alwaysDoneAction( () -> { Actions builder = new Actions(getDriver()); builder.doubleClick(); }); return parent; }
public void doubleClick(String locator) { waitForElement(locator); highlightElement(locator); try { Actions a = new Actions(driver); a.doubleClick(driver.findElement(getLocator(locator))); a.perform(); log.info("Successfully executed DOUBLE CLICK command on the following button: " + locator); } catch (Exception e) { log.error("An error occured when try to DOUBLE CLICK on the following button: " + locator); log.debug(e); captureScreen(getBrowserDetails(driver) + "/operationErrors/click/clickAT" + locator, driver); } }
@Override public boolean doubleClickAt(WebLocator el) { boolean clicked = false; if (ensureExists(el)) { try { Actions builder = new Actions(driver); builder.doubleClick(el.currentElement).perform(); clicked = true; } catch (Exception e) { // http://code.google.com/p/selenium/issues/detail?id=244 LOGGER.info("Exception in doubleClickAt {}", e); clicked = fireEventWithJS(el, "dblclick") != null; } } return clicked; }
@Override public void doubleClick(String locator) { WebElement webElement = getWebElement(locator); WrapsDriver wrapsDriver = (WrapsDriver) webElement; WebDriver webDriver = wrapsDriver.getWrappedDriver(); Actions actions = new Actions(webDriver); actions.doubleClick(webElement); Action action = actions.build(); action.perform(); }
@Override public IUGElement dbClick() { builder.doubleClick(element).build().perform(); return this; }
/** Double clicks on the particular element */ public void doubleClick(MethodParameters model) { Actions action = new Actions(WebDriverClass.getDriver()); action.doubleClick((WebElement) model.getElement()).perform(); }
/** * 展示结果 * * @param driver * @param action * @throws Exception * @creatTime 上午9:21:46 * @author XuYi */ protected void showResult(WebDriver driver, Actions action) throws Exception { WebElement node = driver.findElement(By.xpath(groupNodeXpath)); action.moveToElement(node).perform(); Thread.sleep(800); action.doubleClick(node).perform(); }
public void doubleClickFeature() { Actions act = new Actions(driver); act.doubleClick(driver.findElement(By.id("testid"))); }