The problem is, sometimes the page takes a few seconds to fetch data, and even though I can see the button, it’s like it’s not “active” yet. Katalon either throws a Step Failed error saying it can’t find the element, or it clicks it but nothing happens because the background scripts haven’t finished loading.
I tried to fix it by putting WebUI.delay(5) everywhere, which works sometimes, but it makes my tests so slow! And if the internet is slightly slower one day, even 5 seconds isn’t enough. Here is the part of the page that is causing the headache:
HTML
<form id="data-entry">
<div id="loading-spinner" class="visible">Loading form data...</div>
<button id="submit-btn" type="submit">Submit</button>
</form>
How do I make Katalon “wait” intelligently instead of just guessing with delays?