In selenium webdriver i want to use if/else condition with java. Each steps need to be checked and need to execute one by one. For example
Log.info("Clicking on Reports link");
WebElement menuHoverLink = driver.findElement(By.id("reports"));
actions.moveToElement(menuHoverLink).perform();
Thread.sleep(6000);
In this code, i need to check the id once it present it need to perform the action else it need to skip the test case not to be failed.