Katalon waiting on Selenium WebElement

The AUT I am testing consists of a page with cards, with delete buttons and randomized IDs. The target cards to delete, I use Selenium to get, by their title text. The trash icon, when clicked, is supposed to display a loading overlay on the card itself, and then disappear that loading overlay, and the card with it. Also, users can delete one card while others have said loading overlay on them. How to wait for a loading overlay, to appear on such a card, and disappear?

To my knowledge, you cannot do implicit/explicit/fluent waits in Selenium WebDriver, from Katalon Studio, and you also cannot cast a WebElement to a TestObject.

Michael

I do this a lot - we don’t have cards as such, but otherwise it’s the same: I’m waiting for a “loading” image to appear, then disappear during an ajax/server round trip.

I think I mentioned to you before, I use JavaScript to check for these elements: it’s the only 100% reliable method I’ve found. IOW, I don’t deal with WebElements or TestObjects for this kind of thing. Reasoning…

The web page is built from HTML elements, JavaScript (and CSS). So I ask the page, the horse’s mouth, what state it is in and dispense with all the noise from the APIs layered on top. It’s cleaner. It’s clearer.

Your only issue might be the timing of the first appearance of the loading overlay. It’s possible it could appear and then change before you get to check for its presence. Luckily, that hasn’t happened to me yet – under normal load conditions, the network ensures there’s at least a second’s delay before it appears and then eventually disappears.

I’ll leave this now and await any more questions…