1

Where it clears the last text field after clicking submit, is this still a bug in WebDriver? Any workaround? Most of the tests I need to do involve filling in and submitting forms, so if this is an issue I might need to go back to RC...or anyone has a free testing tool similar to selenium in mind, and should be reliable?

    //Enter class harvested

    //text fields
            WebElement blankyear1 = driver.findElement(By.id("combobox0-text"));
    WebElement blankyear2 = driver.findElement(By.id("combobox1-text"));
            WebElement blankyear3 = driver.findElement(By.id("combobox2-text"));

            blankyear3.sendKeys("Barley");
    blankyear1.sendKeys("Wheat");


    WebDriverWait wait = new WebDriverWait(driver, 5);
    wait.until(ExpectedConditions.elementToBeClickable(By.id("combobox2-text")));
            Thread.sleep(3000);

            //last text field that gets cleared out before or after submit? (not sure)  
    blankyear2.sendKeys("Wheat");
    Thread.sleep(3000);
            //Submit application
    driver.findElement(By.name("preSubmitApplication")).click();
    Thread.sleep(3000);

Thanks all.

braX
  • 11,506
  • 5
  • 20
  • 33
maximumride
  • 311
  • 1
  • 4
  • 18
  • I've never seen webdriver cause this kind of behavior. Your code could definitely be cleaned up alot as well. Have you tried seeing what happens when you do the exact same actions manually? Also your description could be more helpful. what is the id of "the last text field"? – Greg Jul 31 '12 at 04:17
  • 1
    oh, it's because, I've tried others' suggestions like using wait, adding a delay and what not. the id is combobox1-text. this is the command blankyear2.sendKeys(Keys.chord(Keys.CONTROL, "a"), "Wheat"); or blankyear2.sendKeys("Wheat"); and it works fine when I input manually, so it's clear it's the Web Driver behavior. – maximumride Jul 31 '12 at 04:33

1 Answers1

0

This thread could have been more clear. It seems to me that you want to select an element out of a combo box after inputting a search. The question has already been solved and appeared as number one on a Google search.

Selenium WebDriver to select combo-box item?

Community
  • 1
  • 1
Greg
  • 5,422
  • 1
  • 27
  • 32
  • Hi Greg, thanks for the reply, pointed me to the specific question I need to ask.It's actually a text field with a list menuitem. It's a text field/combo box where I enter a letter and the list appears so I can select from it but the thing is I should just be able to enter a text using sendKeys because the field is an input type text. – maximumride Jul 31 '12 at 22:41
  • Its funny, I've been running into this problem all afternoon. Does your input work none of the time or only some of the time? Also have you ever received any StaleElementReferenceExceptions when trying to locate your text box? If your problem is the same as mine, I'll let you know the resolution of this when its over. For now I posted a question on Selenium-Users forum look over it to see if is relevant for you https://groups.google.com/forum/#!topic/selenium-users/4pBz4cS6Hrw – Greg Aug 01 '12 at 01:05