18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Mouse over Menu item and test its color changes to "Blue"
Hi
I want to test whether the colour of the Menu Item changes from X to Y when we mouse over that Menu item.
Can you please let me know how we can test this.
Regards
Uday
I want to test whether the colour of the Menu Item changes from X to Y when we mouse over that Menu item.
Can you please let me know how we can test this.
Regards
Uday
Answers
I made a sample script to test your problem out. In the following script, my div is having red background color which changes to green on mouse over. You can use a script similar to the script mentioned below:
Here, i have performed color change on a div. However, you can use the above code for other type of elements as well.
Please let me know if it works for you.
Regards.
Thanks a lot for taking efforts to help me.The code is fine but instead of background color I have to check for text color. Please let me know if you can help me.
Regards
Uday
_mouseOver(_div("SupportMenu"));
_assertEqual("", _div("SupportMenu").style.color);
--Stopped Playback: SUCCESS--
If I dont mention the colour the script is passing as above
If I mention the colour the script is failing as below.
_assertEqual("red", _div("SupportMenu").style.color);
_mouseOver(_div("SupportMenu"));
_assertEqual("blue", _div("SupportMenu").style.color);
--Stopped Playback: FAILURE--
Please give your inuts.
Regards
Uday