Example usage for org.openqa.selenium Keys ENTER

List of usage examples for org.openqa.selenium Keys ENTER

Introduction

In this page you can find the example usage for org.openqa.selenium Keys ENTER.

Prototype

Keys ENTER

To view the source code for org.openqa.selenium Keys ENTER.

Click Source Link

Usage

From source file:org.jitsi.meet.test.mobile.MobileParticipant.java

License:Apache License

/**
 * {@inheritDoc}//from  ww  w  .j a  v  a2s . c  om
 */
@Override
public void doJoinConference(JitsiMeetUrl conferenceUrl) {
    if (type.isAndroid()) {
        maybeAcceptOverlayPermissions();
    }

    // XXX: No need to accept permissions on the welcome page now.

    WelcomePageView welcomePageView = new WelcomePageView(this);

    MobileElement roomNameInput = welcomePageView.getRoomNameInput();

    roomNameInput.sendKeys(conferenceUrl.toString());

    if (type.isAndroid()) {
        roomNameInput.click();

        getAndroidDriver().pressKeyCode(AndroidKeyCode.ENTER);
    } else {
        // NOTE on iOS the most reliable way for closing the keyboard is to
        // send the ENTER key.
        roomNameInput.sendKeys(Keys.ENTER);
    }

    takeScreenshot("roomNameTextEntered");

    // ALLOW to use mic and camera.
    acceptPermissionAlert();
    acceptPermissionAlert();

    ConferenceView conference = new ConferenceView(this);

    // Just to make sure we're in the conference
    conference.getLargeVideo().getValue();
}

From source file:org.jspringbot.keyword.selenium.SeleniumHelper.java

License:Open Source License

private String mapAsciiKeyCodeToKey(int keyCode) {
    Map<Integer, Keys> keysMap = new HashMap<Integer, Keys>();
    keysMap.put(0, Keys.NULL);//w  w  w .j a v  a  2 s  .  c  o m
    keysMap.put(8, Keys.BACK_SPACE);
    keysMap.put(9, Keys.TAB);
    keysMap.put(10, Keys.RETURN);
    keysMap.put(13, Keys.ENTER);
    keysMap.put(24, Keys.CANCEL);
    keysMap.put(27, Keys.ESCAPE);
    keysMap.put(32, Keys.SPACE);
    keysMap.put(42, Keys.MULTIPLY);
    keysMap.put(43, Keys.ADD);
    keysMap.put(44, Keys.SUBTRACT);
    keysMap.put(56, Keys.DECIMAL);
    keysMap.put(57, Keys.DIVIDE);
    keysMap.put(59, Keys.SEMICOLON);
    keysMap.put(61, Keys.EQUALS);
    keysMap.put(127, Keys.DELETE);
    Keys key = keysMap.get(keyCode);

    if (key == null) {
        Character c = (char) keyCode;
        return c.toString();
    }

    return key.toString();
}

From source file:org.jwatter.browser.WebDriverWebAutomationFramework.java

License:Apache License

@Override
public void pressEnterInTextInputWithId(String id) throws NoSuchElementException {
    findTextInputWithId(id).sendKeys(Keys.ENTER);
}

From source file:org.jwatter.browser.WebDriverWebAutomationFramework.java

License:Apache License

@Override
public void pressEnterInTextInputWithName(String name, int which) throws NoSuchElementException, Exception {
    findTextInputWithName(name, which).sendKeys(Keys.ENTER);
}

From source file:org.jwatter.browser.WebDriverWebAutomationFramework.java

License:Apache License

@Override
public void pressEnterInPasswordInputWithId(String id) throws NoSuchElementException {
    findPasswordInputWithId(id).sendKeys(Keys.ENTER);
}

From source file:org.jwatter.browser.WebDriverWebAutomationFramework.java

License:Apache License

@Override
public void pressEnterInPasswordInputWithName(String name, int which) throws NoSuchElementException, Exception {
    findPasswordInputWithName(name, which).sendKeys(Keys.ENTER);
}

From source file:org.kuali.rice.testtools.selenium.WebDriverLegacyITBase.java

License:Educational Community License

protected void typeEnter() {
    jGrowl("Press Enter");
    driver.switchTo().activeElement().sendKeys(Keys.ENTER);
}

From source file:org.kuali.rice.testtools.selenium.WebDriverLegacyITBase.java

License:Educational Community License

/**
 * presses Enter Key
 */
public void pressEnter(By by) {
    findElement(by).sendKeys(Keys.ENTER);
}

From source file:org.musetest.selenium.values.KeystrokesStringSourceTests.java

License:Open Source License

@Test
void testSingleMixedAtEnd() throws MuseInstantiationException, ValueSourceResolutionError {
    ValueSourceConfiguration source = ValueSourceConfiguration.forTypeWithSource(KeystrokesStringSource.TYPE_ID,
            ValueSourceConfiguration.forValue("1{ENTER}"));
    Object result = source.createSource(new SimpleProject()).resolveValue(new MockStepExecutionContext());
    Assertions.assertEquals("1" + Keys.ENTER, result.toString());
}

From source file:org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage.java

License:Open Source License

public static void defineTag(String resourceTags) {
    WebElement tagTextbox = getTagsField();
    tagTextbox.clear();//w  w  w .  j a v a 2s  .  c  o  m
    tagTextbox.sendKeys(resourceTags);
    tagTextbox.sendKeys(Keys.ENTER);
}