GetCSSValue Keyword Usage

Hello Everyone,

I was trying to user verify the Font Size of a given element and I am getting different results when I run that test case in Google Chrome or in Firefox. Katalon is doing its job perfectly and this issue seems to be more of Google Chrome.

When I manually checked in Google Chrome I am seeing Font Size as 17.999 but in Firefox it is showing correctly as 18. The script is failing in Google Chrome because the Size it is expecting is 18 not 17.999. Is there a way that I can make Google Chrome display correct font size?


Oh boy… there’s a can of worms here best avoided if you can.

If I were you, I’d take a pragmatic approach:

  if(n > 17.5 && n < 18.5) 
1 Like

Thanks @Russ_Thomas

I will implement your suggestion. While I was investigating I found Google Chrome is not the culprit for every element, it shows some font sizes correctly for other elements.

Yep. I’m not surprised. We could have a lengthy exchange here and still not get to the bottom of it. I was just saving us both the time by suggesting that approach. In essence, …

The browsers (and webdrivers) are the gatekeepers. If they keep stopping you at the gate, sneak in over the fence. :sunglasses:

1 Like

So true, Thanks @Russ_Thomas for your help.

1 Like