I'm trying to automate a web application with selenium java and this is the message I keep getting org.openqa.selenium.ElementClickInterceptedException: Element is not clickable at point (85,37) because another element obscures it in all the browsers.
I tried all the waits, explicit wait for 20 seconds seems to work but often it fails too. Also, this is happening before almost every element on the application and I think applying explicit wait or Thread.sleep before every element is a good practice.
driver.findElement(By.xpath("//span[contains(text(),'Agent Corrections')]")).click();
WebDriverWait wait1 = new WebDriverWait(driver, 20);
wait1.until(ExpectedConditions.invisibilityOfElementLocated(By.id("preloader")));
String expectedText = "";
String actualText = driver.findElement(By.cssSelector("#users_management > div.panel-heading > h4")).getText();
Assert.assertEquals(expectedText, actualText);
driver.findElement(By.xpath("//span[contains(text(),'')]")).click();
driver.findElement(By.xpath("//span[contains(text(),'')]")).click();
wait1.until(ExpectedConditions.invisibilityOfElementLocated(By.id("preloader")));
driver.findElement(By.id("pcc")).sendKeys("");
driver.findElement(By.id("pnr")).sendKeys("");
driver.findElement(By.id("FFFormSubmit")).click();
wait1.until(ExpectedConditions.invisibilityOfElementLocated(By.id("preloader")));
element obscuring is with div id = preloader