Perform assertion while hovering on an element

Is there a way to assert a change in a selector based on mouse hover?

I have a catalog screen where item is displayed. Below the item there are different color options. Hovering on these options updates the main item image.


When I hover on another color, the “src” attribute of the main image updates.

img class=“item-result__image item-result__image–secondary” src=“”>

I can perform mouseover on the other color, but while performing that action, is it possible to validate/assert the src tag change?

you can get the value of src attribute using

String src = WebUI.getAttribute(TestObject, "src")
assert src == ""