White Box Testing
Test your code
   Home      selenium2WebDriver-DataInput
 
Selenium WebDriver Data Input
 
 
1) Find and locate the web element text-box by ID and input data through sendKeys() method. If the text box is having some default value call clear() method on web element
 
                        driver.findElement(By.id("q2")).clear();
                        driver.findElement(By.id("q2")).sendKeys("hello");
                       
 
2) Find and locate the web element radio-button by ID and select/enable by click() method
 
                        driver.findElement(By.id("q9_1")).click();
 
                       
3) Find and locate the web element check-button by ID and select/enable by click() method. Further we can verify if the check-box isSelected()/isEnabled()
 
                        System.out.println("Check-box selected " + driver.findElement(By.id("q10_2")).isSelected());
                        driver.findElement(By.id("q10_2")).click();
                        System.out.println("Check-box selected " + driver.findElement(By.id("q10_2")).isSelected());
                       
 
4) Find the combo-box  through Select class and further select combo-box value/option by selectByVisibleText(or selectByIndex, selectByValue)
 
                        Select comboBox = new Select(driver.findElement(By.id("q11")));
                        comboBox.selectByVisibleText("O 2");
 
                       
5) Find and locate the web element page splitter and click()
 
                        driver.findElement(By.id("td_q23")).click();
 
                       
6) Find and locate the web element button and click() or submit()
 
                        driver.findElement(By.className("btn")).submit();
 
   alternatively can be clicked
                        
                        //driver.findElement(By.className("btn")).click();
 
 
Download example code Selenium WebDriver Data Input