This is a practice test case where i have to login to gmail and click on all the checkbox in the dynamic web table and delete the mails. So i made the following code.
Th
You probably chose not so automation friendly web app like Gmail to start with. I believe they have deliberately developed Gmail client side in such a way that its harder for a Robot to perform actions.
As for your question, I think the delete button appears a little after check boxes are clicked. So I believe you will have to explicitly wait for the button to appear. It's also possible that your xpath is not correct.
You could try this,
WebDriverWait wait = new WebDriverWait(driver, 60 /*timeOut in Seconds*/);
wait.until(ExpectedConditions.
visibilityOfElementLocated(By.css("div[data-tooltip='Delete']"))).click();