groovy - Geb test intermittent failure firefox - org.openqa.selenium.WebDriverException: Element is not clickable at point -
i getting following error intermittently @ component click in geb ui tests on firefox 45.0.1, selenium 2.53.1 , following jars:
geb-spock-1.1.1.jar
geb-core-1.1.1.jar
geb-ast-1.1.1.jar
geb-waiting-1.1.1.jar
geb-implicit-assertions-1.1.1.jar
geb-exceptions-1.1.1.jar
geb-test-common-1.1.1.jar
spock-spring-1.0-groovy-2.4.jar
spock-core-1.0-groovy-2.4.jar
org.openqa.selenium.webdriverexception: element not clickable @ point (499.95001220703125, 375.6000061035156). other element receive click:
the tests fail intermittently. adding sleep of 200 ms before component click viz. sleep(200) not want use sleep() such fix time values sake of practice.
waitfor() not either:
mybutton(wait:true) {$('#mybtn')} waitfor { mybutton.isdisplayed() } mybutton.click()
launching tests in full screen not make things better:
def setupspec() { getdriver().manage().window().maximize() }
its element displayed
before clickable
have seen behaviour clickable elements animate. e.g.
- page loads
- button displayed
- button begins animating
- button animation finishes
- button clickable
given intermittent suspect problem related. might not animation related simple race condition.
you add method pageobject or better create custom navigator waits element clickable:
def waitforandclick(navigator element, integer timeoutseconds) { def timestart = new date().gettime() while ( timestart <= timestart + timeoutseconds ) { try { element.click() } catch (webdriverexception ex) { pass } break } }
hope helps.
Comments
Post a Comment