I am using Selenium IDE and Selenium web driver testng in eclipse .. my testing is against ZK application ..
the test case works fine on Selenium IDE ..
Naif,
Actually, your above question is different than the actual question hence you should have asked it as a separate question. Still, I'm answering to your previous question.
The error is because the element you're trying to click on isn't visible. Before you click on element, it should be visible. You can do this by following -
WebElement element = driver.findElement(By.xpath("//div[2]/div[2]"));
WebDriverWait wait = new WebDriverWait(driver, 20); //here, wait time is 20 seconds
wait.until(ExpectedConditions.visibilityOf(element)); //this will wait for elememt to be visible for 20 seconds
element.click(); //now it clicks on element
If above doesn't work, you can click on element by executing javascript(but this isn't a good practice)
JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript("arguments[0].click();", element);
I'm not sure but try and see if following works for you. First, you've to make that element visible before interacting with it -
WebElement element = driver.findElement(By.xpath("//div[2]/div[2]"));
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", element);
The above code will scroll down till the element is visible and then you can click on it.
I was getting this error in slightly different context where I was trying to click anchor tag with the selenium RemoteWebDriver (I was trying to replace WebDriver). The fix was identifying the right set of capability for the driver for eg:
capability = DesiredCapabilities.chrome();
capability.setPlatform(Platform.WIN10);
capability.setCapability("version", "66");
Try to execute the script and click the element
driver.executeScript("arguments[0].click();", element)