Currently, if explicit waits are enabled, scaffold will wait until an element is displayed prior to clicking the element. Unfortunately, there are instances where the element might be displayed but not clickable. Depending on the design of the site, this can be encountered mostly from slow loading modals; if the modal is partially displayed but not entirely displayed, web driver views this as being "displayed" but when it tries to click the element, it is intercepted by an element other than the modal.
We should update the click method to account for this variability. I anticipate this is a somewhat trivial addition as we can update AbstractClickable's click() method with a try catch around getWebElement().click(), as seen at this link. We can write this try catch as a while loop with a finite amount of retries catching InterceptedElementException. After so many tries, throw an error that the element just couldn't be clicked for whatever the bubbled up reason is.
Include a unit test with a negative test case expectation that includes the scenario of the element not being clickable.
A/C
The click() method in AbstractClickable should include retry logic for interacting with elements that might not yet be clickable
Summary
Currently, if explicit waits are enabled, scaffold will wait until an element is displayed prior to clicking the element. Unfortunately, there are instances where the element might be displayed but not clickable. Depending on the design of the site, this can be encountered mostly from slow loading modals; if the modal is partially displayed but not entirely displayed, web driver views this as being "displayed" but when it tries to click the element, it is intercepted by an element other than the modal.
We should update the click method to account for this variability. I anticipate this is a somewhat trivial addition as we can update
AbstractClickable
'sclick()
method with a try catch aroundgetWebElement().click()
, as seen at this link. We can write this try catch as a while loop with a finite amount of retries catchingInterceptedElementException
. After so many tries, throw an error that the element just couldn't be clicked for whatever the bubbled up reason is.Include a unit test with a negative test case expectation that includes the scenario of the element not being clickable.
A/C
click()
method inAbstractClickable
should include retry logic for interacting with elements that might not yet be clickable