Question: how to select first option from dropdown in selenium?
Answer: selectByIndex(): Here you can use the index to select the option from a drop down. Basically Index starts from 0, so this means for the first option, index will be 0 and so on: WebElement element = driver. findElement(By.id("year")); Select select = new Select(element); select.