Here is my code, by using disable notifications it works for some time and it was not working. i was unable to search required thing.
package section13;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
public class Demo {
public static void main(String[] args) throws Exception {
ChromeOptions options=new ChromeOptions();
options.addArguments("--disable-notifications");
WebDriver driver=new ChromeDriver(options);
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
driver.get("https://www.makemytrip.com/");
System.out.println(driver.getTitle());
//clicking on buses
WebDriverWait wait=new WebDriverWait(driver,20);
wait.until(ExpectedConditions.visibilityOfAllElements(driver.findElement(By.xpath("//div[@class='chHeaderContainer']/nav/ul/li[6]"))));
driver.findElement(By.xpath("//div[@class='chHeaderContainer']/nav/ul/li[6]")).click();
Thread.sleep(2000);
driver.findElement(By.xpath("//div[@class='bussw_inputBox selectHtlCity '][1]")).click();
driver.findElement(By.xpath("//input[@placeholder='From']")).sendKeys("Bang");
driver.findElement(By.xpath("//input[@placeholder='From']")).sendKeys(Keys.DOWN);
driver.findElement(By.xpath("//input[@placeholder='From']")).sendKeys(Keys.DOWN);
driver.findElement(By.xpath("//input[@placeholder='From']")).sendKeys(Keys.DOWN);
System.out.println(driver.findElement(By.xpath("//input[@placeholder='From']")).getText());
JavascriptExecutor js=(JavascriptExecutor)driver;
String script="return document.getElementById('//input[@placeholder='From']').value;";
String text=(String) js.executeScript(script);
System.out.println(text);