List of usage examples for org.openqa.selenium Keys RETURN
Keys RETURN
To view the source code for org.openqa.selenium Keys RETURN.
Click Source Link
From source file:org.neo4j.server.webadmin.steps.WebadminSteps.java
License:Open Source License
@When("^I hit return in the element found by the xpath (.+)$") public void iHitEnterInTheElementFoundByXpath(String xpath) { d.findElement(By.xpath(xpath)).sendKeys(Keys.RETURN); }
From source file:org.openlmis.pageobjects.Page.java
License:Open Source License
public void downloadFileWhileSaveDialogOPen(WebElement element) throws InterruptedException { try {//from w w w . j ava 2 s . c om Robot robot = new Robot(); //get the focus on the element..don't use click since it stalls the driver element.sendKeys(""); element.sendKeys(Keys.RETURN); //wait for the modal dialog to open Thread.sleep(3000); //press s key to save robot.keyPress(KeyEvent.VK_ALT); robot.keyPress(KeyEvent.VK_S); robot.keyRelease(KeyEvent.VK_S); robot.keyRelease(KeyEvent.VK_ALT); Thread.sleep(3000); } catch (AWTException e) { e.printStackTrace(); } }
From source file:org.openlmis.pageobjects.UserPage.java
License:Open Source License
public void enterDeliveryZoneData(String deliveryZoneCode, String program, String role) { testWebDriver.handleScroll();/* w w w .j ava2 s.com*/ testWebDriver.getElementByXpath("//a[contains(text(),'Delivery zones')]").click(); testWebDriver.waitForElementToAppear(zoneToDelivery); testWebDriver.selectByVisibleText(zoneToDelivery, deliveryZoneCode); testWebDriver.waitForElementToAppear(programToDeliver); testWebDriver.selectByVisibleText(programToDeliver, program); testWebDriver.waitForElementToAppear(rolesInputFieldMDeliveryZone); rolesInputFieldMDeliveryZone.click(); rolesInputFieldMDeliveryZone.clear(); rolesInputFieldMDeliveryZone.sendKeys(role); rolesInputFieldMDeliveryZone.sendKeys(Keys.RETURN); addDeliveryZoneRoleButton.click(); }
From source file:org.openlmis.pageobjects.UserPage.java
License:Open Source License
public void enterDeliveryZoneDataWithoutHomeAndSupervisoryRolesAssigned(String deliveryZoneCode, String program, String role) {/*from ww w .j ava 2s . c o m*/ testWebDriver.handleScroll(); deliveryZonesAccordion.click(); testWebDriver.sleep(500); testWebDriver.waitForElementToAppear(zoneToDelivery); testWebDriver.selectByVisibleText(zoneToDelivery, deliveryZoneCode); testWebDriver.waitForElementToAppear(programToDeliver); testWebDriver.selectByVisibleText(programToDeliver, program); testWebDriver.waitForElementToAppear(rolesInputFieldDeliveryZone); rolesInputFieldDeliveryZone.click(); rolesInputFieldDeliveryZone.clear(); rolesInputFieldDeliveryZone.sendKeys(role); rolesInputFieldDeliveryZone.sendKeys(Keys.RETURN); testWebDriver.waitForElementToAppear(addDeliveryZoneRoleButton); addDeliveryZoneRoleButton.click(); }
From source file:org.openlmis.UiUtils.TestWebDriver.java
License:Open Source License
public void keyPress(final WebElement element) { waitForElementToAppear(element);/*from w w w.ja v a2 s . c o m*/ if (driver instanceof FirefoxDriver) { element.sendKeys(Keys.RETURN); return; } if (element != null) { for (int i = 0; i < 15; i++) { element.sendKeys(Keys.TAB); if (driver.switchTo().activeElement().getText().equalsIgnoreCase(element.getText())) { break; } } element.sendKeys(Keys.RETURN); } }
From source file:org.openmrs.module.mirebalais.smoke.pageobjects.AbstractPageObject.java
License:Open Source License
private void setText(WebElement element, String text) { element.clear(); element.sendKeys(text); element.sendKeys(Keys.RETURN); }
From source file:org.openmrs.module.mirebalais.smoke.pageobjects.AbstractPageObject.java
License:Open Source License
public void findPatientById(String patientIdentifier, By idField) throws Exception { WebElement element = driver.findElement(idField); element.sendKeys(patientIdentifier); element.sendKeys(Keys.RETURN); }
From source file:org.openmrs.module.mirebalais.smoke.pageobjects.AppDashboard.java
License:Open Source License
public void findPatientByIdentifier(String identifier) { WebElement searchField = driver.findElement(SEARCH_FIELD); searchField.sendKeys(identifier); searchField.sendKeys(Keys.RETURN); }
From source file:org.openmrs.module.mirebalais.smoke.pageobjects.AppDashboard.java
License:Open Source License
public void findPatientByName(Patient patient) { WebElement searchField = driver.findElement(SEARCH_FIELD); searchField.sendKeys(patient.getName()); // search on patient name searchField.sendKeys(Keys.RETURN); // patient should be in results list WebElement searchResults = driver.findElement(SEARCH_RESULTS_TABLE); searchResults.findElement(By.xpath("//*[contains(text(), '" + patient.getIdentifier() + "')]")).click(); }
From source file:org.openmrs.module.mirebalais.smoke.pageobjects.AppDashboard.java
License:Open Source License
public void findPatientByGivenAndFamilyName(String givenName, String familyName) { WebElement searchField = driver.findElement(SEARCH_FIELD); searchField.sendKeys(givenName + " " + familyName); searchField.sendKeys(Keys.RETURN); // patient should be in results list WebElement searchResults = driver.findElement(SEARCH_RESULTS_TABLE); searchResults.findElement(By.xpath("//*[contains(text(), '" + familyName + ", " + givenName + "')]")) .click();//from w w w .j a va 2s. c o m }