[mobile] Can't check color, font size

mobile.getCSSValue (findTestObject (‘Page_CuraAppointment / btn_BookAppointment’), ‘font-size’)

So what you expected from the script and how it went wrong?

I also have this problem. I’m can’t find “keywords” is support get color by element

Hi @qup.nghiahuynh05,

It looks like the Mobile library doesn’t have a getCSSValue() function, but the WebUI library does. Could you try using that? If that doesn’t work, can you please share your test code?

https://docs.katalon.com/katalon-studio/docs/webui-get-css-value.html#description

Hope this helps,

Chris

Hi All,

I have the same issue. I would like to know how to get the colors and font styles of an element such as the button, text, header, etc. in mobile (apk/ipa) in order to test our customized apps.

Thank you,
Debbie

Hi @dbjaaay18,

I think the issue you will encounter is that native mobile element styles aren’t exposed/reported by Appium, so you can’t get access to them in your tests.

Some workarounds to get the color of an element involve taking a screenshot and then inspecting the color of specific pixels:

I don’t see a way to detect the type of font, though.

Hope this helps,

Chris

Hi Chris,

Thank you so much for this. I will try it on my script. :slight_smile:

Regards,
Debbie

yes even i tto tried.if you got any solution let me know .by using css