public boolean isRubricWeightBoxFocused(int qnNumber, int subQnIndex, int choiceIndex) { WebElement weightBox = getRubricWeightBox(qnNumber, subQnIndex, choiceIndex); return weightBox.equals(browser.driver.switchTo().activeElement()); }
public boolean isMcqOtherWeightBoxFocused(int qnNumber) { WebElement weightBox = getMcqOtherWeightBox(qnNumber); return weightBox.equals(browser.driver.switchTo().activeElement()); }
public boolean isMsqOtherWeightBoxFocused(int qnNumber) { WebElement weightBox = getMsqOtherWeightBox(qnNumber); return weightBox.equals(browser.driver.switchTo().activeElement()); }
@Override public boolean isPseudoClass(WebDriver driver, WebElement element, PseudoClassSelector pseudoClassSelector) { WebElement currentlyActiveElement = driver.switchTo().activeElement(); return element.equals(currentlyActiveElement); }
public Optional<FluentElement> focusedElement() { WebElement focusedElement = webDriver.switchTo().activeElement(); if(focusedElement.getTagName().equalsIgnoreCase("body")) { return Optional.of(new FluentElement(webDriver, focusedElement)); } else { return Optional.absent(); } }
public WebElement activeElement() { logger.verbose("Switching to element..."); WebElement element = targetLocator.activeElement(); if (!(element instanceof RemoteWebElement)) { throw new EyesException("Not a remote web element!"); } EyesRemoteWebElement result = new EyesRemoteWebElement(logger, driver, element); logger.verbose("Done!"); return result; }
/** * See parent. */ @Override public WebElement activeElement() { return targetLocator.activeElement(); }
/** * @since 2.14 */ public TimedCondition isLabelInputFocused() { return Conditions.forSupplier(() -> driver.switchTo().activeElement().getAttribute("id").equals(labelsInput.getAttribute("id")) ); }
@Test public void testAutoRefocusWButton() { SeleniumWComponentsWebDriver driver = getDriver(); String path = "TextDuplicator/WButton"; driver.findElement(byWComponentPath(path)).click(); Assert.assertEquals("Incorrect focus", driver.findElement(byWComponentPath(path)).getActiveId(), driver.switchTo(true).activeElement().getAttribute("id")); }
public ResultType call() throws Exception { response = newResponse(); WebElement element = getDriver().switchTo().activeElement(); String elementId = getKnownElements().add(element); response.setValue(Collections.singletonList(String.format("element/%s", elementId))); return ResultType.SUCCESS; }
public WebElement activeElement() { return targetLocator.activeElement(); } }
@Override public void sendKeys(CharSequence... keysToSend) { WebElement toElement = parent.switchTo().activeElement(); HtmlUnitWebElement htmlElem = getElementToSend(toElement); htmlElem.sendKeys(keysToSend); }
@Override public void pressKey(CharSequence keyToPress) { WebElement toElement = parent.switchTo().activeElement(); HtmlUnitWebElement htmlElement = getElementToSend(toElement); modifiersState.storeKeyDown(keyToPress); htmlElement.sendKeyDownEvent(keyToPress); }
@Override public void releaseKey(CharSequence keyToRelease) { WebElement toElement = parent.switchTo().activeElement(); HtmlUnitWebElement htmlElement = getElementToSend(toElement); modifiersState.storeKeyUp(keyToRelease); htmlElement.sendKeyUpEvent(keyToRelease); }
private HtmlUnitWebElement getElementToSend(WebElement toElement) { WebElement sendToElement = toElement; if (sendToElement == null) { sendToElement = parent.switchTo().activeElement(); } return (HtmlUnitWebElement) sendToElement; }
public ResultType call() throws Exception { response = newResponse(); WebElement element = getDriver().switchTo().activeElement(); String elementId = getKnownElements().add(element); response.setValue(Collections.singletonList(String.format("element/%s", elementId))); return ResultType.SUCCESS; }
public boolean isMsqWeightBoxFocused(int qnNumber, int choiceIndex) { WebElement weightBox = getMsqWeightBox(qnNumber, choiceIndex); return weightBox.equals(browser.driver.switchTo().activeElement()); }
public boolean isMcqWeightBoxFocused(int qnNumber, int choiceIndex) { WebElement weightBox = getMcqWeightBox(qnNumber, choiceIndex); return weightBox.equals(browser.driver.switchTo().activeElement()); }
public boolean isRubricSubQuestionBoxFocused(int qnNumber, int subQnIndex) { WebElement subQnBox = getRubricSubQuestionBox(qnNumber, subQnIndex); return subQnBox.equals(browser.driver.switchTo().activeElement()); }
@Override public WebElement activeElement() { return delegate.activeElement(); }