Wait for element present and click

I created a test where I fill in a search field to find an item to click on. I inserted a “wait for element present”, to wait for the element clickable to be present, but it does not work, the click is faster than the “Wait” and an element is clicked, wrong, before the search even takes place.

WebUI.callTestCase(findTestCase('Test Cases/Reuse Test Case/2. Login'), [:], FailureHandling.OPTIONAL)
		WebUI.click(findTestObject('Object Repository/Reinvia email di invito (Agency)/partners'))
		WebUI.click(findTestObject('Object Repository/01-Agency/reinvia email di invito/Carrier') )
		WebUI.setText(findTestObject('Object Repository/01-Agency/reinvia email di invito/Reinvia email - search sender'), 'bob')
		WebUI.waitForElementClickable(findTestObject('Object Repository/01-Agency/documenti clienti/bob'), 30)
		WebElement element = WebUiCommonHelper.findWebElement(findTestObject('Object Repository/01-Agency/documenti clienti/bob'), 30)
		WebUI.executeJavaScript("arguments[0].click()", Arrays.asList(element))

@Chris_Trevarthen, @duyluong

Hi @fap

The lines are executed sequentially, it means that it is impossible for the click to happen before the wait statement, if you put the wait statement first. Please provide the console log of the execution.