I want to check one element, with help of that element id, prepared selenium web driver script, when will click on that ui element it will open another hided section on same window, but getting error "Element not visible" Before few days it was working with same script using "id" locator. I am learning automation and don't understand it was working before and now why getting this error. Please let me know if anyone faces this issue and have a solution to resolve it.
The HTML:
<h3 id="hubH3-524" title="pretest" ng-click="toggleSelection('hubH3-524','pretest',1)" role="button" tabindex="0" style="font-size: 9px; padding: 9px 0px 2px;">pretest</h3>
My code:
public class Simpletest {
public static void main(String[] args) {
try {
System.setProperty("webdriver.chrome.driver","E:\\Selenium\\seleniumchromedriver\\chromedriver.exe");
WebDriver driver= new ChromeDriver();
driver.manage().deleteAllCookies();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
driver.get("http://abc.com");
driver.findElement(By.id("username")).sendKeys("enter email");
driver.findElement(By.id("password")).sendKeys("enter password");
driver.findElements(By.className("abcGenericButton")).get(2).click();
Thread.sleep(1000);
new WebDriverWait(driver, 1000).until(ExpectedConditions.visibilityOf(driver.findElement(By.id("hubH3-3"))));
//driver.findElement(By.id("hubH3-3")).click();
driver.findElement(By.id("detailBtn")).click();
driver.findElement(By.id("btnSettingsHub")).click();
driver.findElement(By.id("hubDescription")).click();
WebElement hubDescription = driver.findElement(By.id("hubDescription"));
hubDescription.sendKeys("This is testing hub");
} catch (Exception e) {
e.printStackTrace();
}
}