Identify the font color for item in JavaList [QTP, UFT, VBScript]

180 Views Asked by At

How to identify the font color for an item in a JavaList?

I have a challenge I can't solve and need some guidance. I have a JavaList with several items (ie. rows, where each row is a string of text). This JavaList is like a log file where the font color will be color coded ('red' for something bad, 'green' for something good). I'm trying to read through the list and identify (1) the text and [solved] (2) the font color for each line [how?].

Here's where I need some help. I still yet to figure out how to determine the font color for each line

Sample Code

desiredItemNumber = 20    'this value is arbitrary or determined elsewhere

Set myJavaList = JavaWindow(ABC).JavaList(XYZ)  
myLineItem = myJavaList(desiredItemNumber)
myFontColor = ????

print myLineItem          'this prints the text as desired
print myFontColor

I unsuccessfully tried .ChildObjects but I believe UFT sees the line items as 'items' and not 'objects'

<did not work>
L1_objects = myJavaList.ChildObjects
myFontColor = L1_objects(desiredItemNumber).GetROProperty('foreground') 

any help is appreciated

0

There are 0 best solutions below