GroovyCastException in Katalon when performing Selenium explicit wait GroovyCastException in Katalon when performing Selenium explicit wait selenium selenium

GroovyCastException in Katalon when performing Selenium explicit wait


You were pretty close. The ExpectedConditions method textToBe() is defined as follows:

public static ExpectedCondition<java.lang.Boolean> textToBe(By locator, java.lang.String value)An expectation for checking WebElement with given locator has specific textParameters:locator - used to find the elementvalue - used as expected textReturns:Boolean true when element has text value equal to @value

So you just need to change the return type to boolean instead of WebElement as follows:

Boolean status = dashboardChangeWait.until(ExpectedConditions.textToBe(By.cssSelector('.breadcrumb-item.active'), "DASHBOARD"))