jeudi 24 mai 2018

Element is clickable just sometimes

I'm writing a test for a standard form. I have a textbox, date, select.. all kinds of inputs, and at the end, a Reset and Filter button. In Date field, there is always a date by default. I need to press Reset button in order to clear all the fields, and then push Filter button. This way, all "Required Field" messages are shown so I can test them. I had some trouble pushing Reset button so I tried this code:

@When("I push Reset Button$")
public void pushReset(){    
wait.until(ExpectedConditions.elementToBeClickable(formOne.resetButton)).click();

So I launch the test, and sometimes Reset Button is pushed and all steps are passed. If I launch it again, Resset button hasn't been pressed. Then I launch it again, it works... Since there are no changes in the DOM, CSS, HTML or similar, I have no idea what's going on

Any help? Thanks in advance

Aucun commentaire:

Enregistrer un commentaire