How to monitor / verify for class change

Hi all, I hope to have picked the right category…
Not a programming expert at all, but have gained a basic idea and want to get more into using Kantu. So please excuse any weird phrasings or wrong uses of specific terms.

As part of one of my projects I want to monitor a “preloaded” online shop. The problem I run into here is that if I use verifyElementpresent I always get a positive result, as all elements are already loaded (even if not shown) - I want to combine it with an if clause base on the ${!LastCommandOK} result.
I have also tried it with the visualVerify option, but also wasn’t too great and somehow kinda prone for failure. Not sure why, but I also felt it was kinda slow and would currently prefer another way here.

So my idea now is to monitor for a change in a class. The code there is like:

<div id="modal-notification" class="XXX">

and after a click that is execute it changes to:

<div id="modal-notification" class="YYY">

Unfortunately, I have no idea how I could approach this… Or is that a really stupid path to take for some reason? If anyone could help me with any ideas or recommendations that would be great!

Thanks a lot it advance! :upside_down_face:

Some ideas:

  • visualVerify (you tried this already. It is slower since it used computer vision, but should work)

  • sourceSearch <- if the change is visible in the page source code

  • storeAttribute | locator@class | var1 => extract class name and monitor for a change

Thanks you very much for your ideas! I’ll report back on what my experiences were as soon as I have time to read up about these options and have tried them!

Only now I found time to look into the options and try them.
The option with
storeAttribute | locator@class | var1
works perfectly! Thanks a lot again!