private void login() { WebElement userNameElement = waitForElementById("user_name", 60); WebElement passwordElement = waitForElementById("user_password"); userNameElement.sendKeys(username); passwordElement.sendKeys(password); passwordElement.submit(); driver.get(getPulseURL() + "clusterDetail.html"); WebElement userNameOnPulsePage = (new WebDriverWait(driver, 30, 1000)).until( (ExpectedCondition<WebElement>) d -> d.findElement(By.id("userName"))); assertNotNull(userNameOnPulsePage); }
protected void doSimpleWebdriverTest(BrowserWebDriverContainer rule) { RemoteWebDriver driver = setupDriverFromRule(rule); System.out.println("Selenium remote URL is: " + rule.getSeleniumAddress()); System.out.println("VNC URL is: " + rule.getVncAddress()); driver.get("http://www.google.com"); WebElement search = driver.findElement(By.name("q")); search.sendKeys("testcontainers"); search.submit(); List<WebElement> results = new WebDriverWait(driver, 15) .until(ExpectedConditions.visibilityOfAllElementsLocatedBy(By.cssSelector("#search h3"))); assertTrue("the word 'testcontainers' appears in search results", results.stream() .anyMatch(el -> el.getText().contains("testcontainers"))); }
public void submit() { submitButton.submit(); }
public static void main(String[] args) { WebDriver driver = new FirefoxDriver(); driver.get("http://www.google.com"); WebElement element = driver.findElement(By.name("q")); element.sendKeys("Cheese!\n"); // send also a "\n" element.submit(); // wait until the google page shows the result WebElement myDynamicElement = (new WebDriverWait(driver, 10)) .until(ExpectedConditions.presenceOfElementLocated(By.id("resultStats"))); List<WebElement> findElements = driver.findElements(By.xpath("//*[@id='rso']//h3/a")); // this are all the links you like to visit for (WebElement webElement : findElements) { System.out.println(webElement.getAttribute("href")); } }
public void submitEditForm() { WebElement submitBtn = browser.driver.findElement(By.id("submitBtn")); submitBtn.submit(); }
public void submitResendPublishedEmailForm() { resendPublishedEmailModal.findElement(By.name("form_email_list")).submit(); }
public void submitRemindParticularUsersForm() { remindModal.findElement(By.name("form_remind_list")).submit(); }
public void submitResendPublishedEmailForm() { resendPublishedEmailModal.findElement(By.name("form_email_list")).submit(); }
public class SearchPage { // The element is now looked up using the name attribute, // and we never look it up once it has been used the first time @FindBy(how = How.NAME, using = "q") @CacheLookup private WebElement searchBox; public void searchFor(String text) { // We continue using the element just as before searchBox.sendKeys(text); searchBox.submit(); } }
/** * Submit the copy page form and expect to receive an overwrite warning. * * @return the overwrite warning page */ public CopyOverwritePromptPage clickCopyButtonExpectingOverwritePrompt() { this.copyButton.submit(); return new CopyOverwritePromptPage(); } }
/** * Submit the copy overwrite prompt page form. * @return the copy confirmation page. */ public CopyOrRenameOrDeleteStatusPage clickCopyButton() { this.copyButton.submit(); return new CopyOrRenameOrDeleteStatusPage(); }
/** * Submits selected file by simply submitting the whole form, which contains this file input. */ public void submit() { getWrappedElement().submit(); }
/** * Perform a site search using the value in the search field, limited to space entities. */ public SearchResultPage submitSearch() { searchForm.submit(); return pageBinder.bind(SearchResultPage.class); }
/** * Jump to the home page of the space matching the value in the search field. */ public ViewPage submitSearchForOneResult(Content pageEntity) { searchForm.submit(); return pageBinder.bind(ViewPage.class, pageEntity); }
public void login(String username, String password, boolean rememberMe) { //clear the username and password fields first before typing it in - this works around the chrome browser //saving the username/password on autocomplete usernameField.clear(); usernameField.sendKeys(username); passwordField.clear(); passwordField.sendKeys(password); if (rememberMe) { rememberMeTickBox.click(); } loginForm.submit(); }
public void login(String username, String password, boolean rememberMe) { //clear the username and password fields first before typing it in - this works around the chrome browser //saving the username/password on autocomplete usernameField.clear(); usernameField.sendKeys(username); passwordField.clear(); passwordField.sendKeys(password); if (rememberMe) { rememberMeTickBox.click(); } loginForm.submit(); }
public void importLocalFile(String filePath) { File mbox = TempDirectory.resourceToTemporaryFile(filePath); localImportForm.findElement(By.name("file")).sendKeys(mbox.getAbsolutePath()); localImportForm.submit(); } }
public CreatePage selectTemplateWithoutVariables(String templateId) { final By templateIdLocator = By.id(templateId); final By choosetemplateformLocator = By.name("choosetemplateform"); driver.waitUntilElementIsVisible(templateIdLocator); driver.findElement(templateIdLocator).click(); driver.waitUntilElementIsVisible(choosetemplateformLocator); driver.findElement(choosetemplateformLocator).submit(); return pageBinder.bind(CreatePage.class); }
public EditSiteLayoutsPage submit() { waitUntilTrue(editDecoratorForm.timed().isVisible()); WebElement decoratorForm = driver.findElement(By.name("editdecorator")); decoratorForm.submit(); return pageBinder.bind(EditSiteLayoutsPage.class); } }