Selecting option from the drop Down List
Example Link: https://automaticselenium.blogspot.com/p/example-drop-down.html
***********************CODE*******************
package aveditor;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.Select;
public class NewTest {
public static void main(String []args) throws Exception
{
WebDriver driver;
System.setProperty("webdriver.chrome.driver", "C:\\Users\\oracle\\Music\\ChromeDriverPath\\chromedriver.exe");
driver=new ChromeDriver();
driver.get("https://automaticselenium.blogspot.com/p/example-drop-down.html");
driver.manage().window().maximize(); //Maximize the Window after Opening the Links
// Select "Selenium Grid" from the given Drop Down box
Select drop=new Select(driver.findElement(By.xpath("//select[@id='selenium']")));
drop.selectByVisibleText("Selenium Grid");
drop.selectByValue("Selenium RC")
}