My first question here. I hope this question is not already answered. I previously searched if it exists, sorry if I'm wrong.
My question is the next. I have this webelement in a PageObject class for automated tests:
//Customer filter
@FindBy(id = "customer_filter")
private WebElement customerFilter;
Later I try to check if it's present or not, like this:
Boolean test = customerFilter.isDisplayed();
But it doesn't work, it says the webelement is not present when actually is not present, and the test ends. I've also tried with isEnabled() and isSelected(). I have to use instead the next code so everything works:
Boolean isPresent = driver.findElements(By.id("customer_filter")).size() > 0;
if(isPresent){
Is there a way to use webelement directly so I don't have to continuosly use the id locator?
Thanks in advance!!!
Edit: Looking for a little more information, I found this thread about the same problem, but it wasn't resolved: https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/1880