I am trying to execute below Selenium Web driver script, But I am getting org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and so may n
Finally this worked for me. Element is not currently visible and so may not be interacted with.
Initially it was like test was successful only 2 of 5 times. Was not sure how it was working sometimes and others not.
Worked by reducing the security settings in IE. Enable all activeX controls. Enable scripts and IFRAMES also. Some of these will warn to put computer at risk, but it was the only solution I had. Introduce Explicit wait by using presenceOfElementLocated instead of visibilityOfElementLocated at every point where page load takes time.
WebDriverWait wait = new WebDriverWait(driver,30);
wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@id='campaignListTable']"))); /*examining the xpath for a search
box*/
driver.findElement(By.xpath("//*[@id='campaignListTable']")).sendKeys("TEXT"); /*enter text in search
box*/