Am using selenium webdriver 2.210 + JAVA for testing.I have a sample code for selecting all mails in gmail.But the code throws an "Element is not currently visible and so may not be interacted with" error when i tries to put a 5sec delay after getting URL through webdriver.Is it possible to make this code working with delay?
driver.get("https://mail.google.com/mail/u/0/?shva=1#all");
delay(5); ////*......Working fine without this...........*////
driver.switchTo().frame(driver.findElement(By.id("canvas_frame")));
driver.findElement(By.xpath("//div[@class = 'T-Jo-auh']")).click();
Thanks in advance
//div[@class = 'T-Jo-auh']element on page really invisible after some time? What do you see when you find it with Firebug? You could tryList<WebElement> list = driver.findElements("//div[@class = 'T-Jo-auh']");and then look in the list for the first visible element by testing withisDisplayed()- Petr Janeček