I'm using a library "Selenium" on Java to write a script to perform online tasks. It works perfectly fine on sites like facebook, youtube, etc. For some reason, in this website it does not: kingdoms.com . The button I want to click has this line of code:
<a data-mellon-iframe-url="/authentication/login" id="loginButton" data-selector="#mellonModal" class="jqFenster"><button> <span>Entrar</span></button></a>
The code I wrote for that is:
driver.findElement(By.id("loginButton")).click();
And it does not click. But if I print this line:
System.out.println(driver.findElement(By.id("loginButton")).getText());
it prints "Entrar", so the script knows the button but for some reason it won't click it.
Any idea? I've tried putting the script on sleep for 3s before clicking, for the case the button wasn't load on time, but it didn't fix it...