How to verify that the color of a field is coming as expected

Hi Team,

I am new to Katalon Studio and want to utilize it for my future projects. I have one question:
1- How to validate that the color of a field is coming as expected in a website?
2- Which Keyword to use and how to utilize it better.

I have tried searching over forums and documentation but with no help.

Waiting for your response

Thanks

Can someone please help

Hi Abhishek!

I also looking for the color verifying of some text. I haven’t found a direct way but found some workaround. Maybe, it’ll be useful for you.

css_color = WebUI.getCSSValue(findTestObject(‘Login/span_Email cant be blank’), ‘color’)

println(css_color)

WebUI.verifyEqual(css_color, ‘rgba(221, 42, 59, 1)’)

I’ve used “println” for the taking current value because the css_color is not verified by the Hexadecimal value. You should remove it when you’ll know the RGBA Colors value.

Vyacheslav Protsiuk said:

Hi Abhishek!

I also looking for the color verifying of some text. I haven’t found a direct way but found some workaround. Maybe, it’ll be useful for you.

css_color = WebUI.getCSSValue(findTestObject(‘Login/span_Email cant be blank’), ‘color’)

println(css_color)

WebUI.verifyEqual(css_color, ‘rgba(221, 42, 59, 1)’)

I’ve used “println” for the taking current value because the css_color is not verified by the Hexadecimal value. You should remove it when you’ll know the RGBA Colors value.

Thanks for your response.

1 Like

I used the following to get the background color of a textbox:
textbox_color = WebUI.getCSSValue(findTestObject(‘Object Repository/CSS/CSS/input_controlled_UC2rgDatactl00ctl04tbData’),
‘background-color’)