Automation - Selenium - Catch a failure
Customer
Anz Bank
Use Case
Issue
Trying to capture an Exception/failure in a Synthetic scenario using Mvel won’t work (it is not supported):
CODE
try {
wait.until(ExpectedConditions.elementToBeClickable(By.partialLinkText("Find Customer")));
wait.until(ExpectedConditions.not(ExpectedConditions.presenceOfAllElementsLocatedBy(By.className("siebui-busy"))));
log.info("**************************************************try****************");
} (Exception ex){
log.info("**************************************************catch****************");
}
Solution
In more recent version of Germain, you can create these selenium scripts in Javascript (instead of Mvel):
![](../__attachments/3681665195/image-20230102-214735.png?inst-v=baad7441-1094-48da-b263-fa99f8ae5725)
Full script
Explanation