I have an elements wich background colors are changing (drawing will remain the same), so I am tring to test it with visualAssert, but I always get a score of 1 (or roughly 0.9x) even if the colors is not the good one (eg. red instead of green, …).
Is it normal that VisualAssert doesn’t check color ?
Is there a way to correct it ?
Can you extrapolate from the page code (html, css) the RGB code it is using? You could get it as a second step check.
About the visualAssert, I didn’t find a reference about the way it treats colours in the documentation, so I can really help on that, sorry
For exampleI got an expected button with red background rgb (220, 53, 69) but having green one (40, 167, 69), visual comparaison
I manage to get the information (and to control it) by getting DOM element but I’m expecting to check only by visual comparison as totaly black box / not doing hypothesis on DOM structuratoin
Hi @ECuinet - you are correct that the current computer vision algorithm puts emphasis on form over color, but I understand that sometimes the color is key.
=> Can you please post some screenshots of the buttons? Maybe we have an idea for a workaround. For example, is it a solid color?
Reliably identify and find e. g. a green, blue or red button? This means you have 3 different UI test input images and want to find the right button on the screen for each input image.
Or find the button (regardless of its background color) and then find out what background color it has?
It’s the first option, compare part of web pages with different UI test pictures from specifiation (the only modification is background of a button).
Will try with visionLimitSearchArea tomorrow because position is stable
I have tried with visionLimitSearchArea, same result (which is logical if vision algorithm emphase forms and not color).
But I got some strange comportment during the following test :
Various step (in my case set proxy to simulate network failure which will change button from green : (class badge-success) to red (class badge-danger)
Check button state with assertElementPresent //*[@id=“indicateurConnexion”][contains(@class,“badge-danger”)]
Limit searchArea to the button
visualAssert to check the color of the button (image = button included background + text)
Step 2 passed with success, but after step 4 the _lascreenshot.png I got in Screenshots tab is displaying button with green background, so screenshot is not representating current step (timestamp of screenshot is ok and compliant with time of exuction of step 4).