Got the following code:
driver.findElement(By.id(\"input_search\")).click();
driver.findElement(By.id(\"input_search\")).clear();
if(lower3 == true){
//re
You can use any of these to solve your purpose:
Solution 1: Verify an element after search action performed.
driver.findElement(By.id("input_search")).clear();
driver.findElement(By.id("input_search")).click();
//here write code to wait for an element available on search result page
try{
if(driver.findElement(By.id("search result page element")).isDisplayed() == true){
System.out.println("Search successful");
} catch (NoSuchElementFound ee){System.out.println("Search not successful");}
Solution 2: Check for page loaded or not after search action performed using java script.
driver.findElement(By.id("input_search")).clear();
driver.findElement(By.id("input_search")).click();
//here write code to wait for sometime around 10-20 seconds
JavascriptExecutor jsExecutor = (JavascriptExecutor)driver;
String s = (String) jsExecutor.executeScript("var s1 = 'Search successful'; var s2 = 'Search not successful'; if(document.readyState === 'complete'){return s1;} else {return s2;}");
Both the code snippet is tested for Google.