title: How to use selenium webdriver to select an option of Bootstrap select dropdown menu?
body: <p>I've to select a country from dropdown of <a href="https://www.parcelhero.com" rel="nofollow noreferrer">https://www.parcelhero.com</a> but when I use the below code for it, sometimes it works sometimes not, giving error of Element not found(xpath("//*[@id='dvQuoteFrom']/div/button"))</p>
  
  <pre><code>driver.findElement(By.xpath("//*[@id='dvQuoteFrom']/div/button")).click();
  
          Thread.sleep(4000);
  
         WebElement txt = driver.findElement(By.xpath("html/body/div[14]/div/div/input"));
  txt.sendKeys("Great Britain");
  List &lt;WebElement&gt; InnerDropdown1 =driver.findElements(By.xpath("//*[@class='active']"));
         for(WebElement option1 :  InnerDropdown1)
          {   System.out.println(option1.getText());
  
          if(option1.getText().contains("Great Britain")) {
            option1.click();
             break; 
         }
          }
  </code></pre>
  
  <p>When I used 
  WebElement txt = driver.findElement(By.className("bs-searchbox")); then also I got the uable to find element error.</p>
  
  <p>Please help me to select a country of my choice from the country dropdown? </p>