I am new to TestComplete and working with Keyword Tests to test my GUI application. I want to see if a button on my screen is red, yellow, or green. I can do a property checkpoint on each of the color properties (e.g. button is red):
Aliases.XXX_ShellView.ShellView.LayoutDocumentPaneControl.RXLed_C.Fill.GradientStops.zcollection.zlistStore.zentry0.Color, "B", 0, 0, True
Aliases.XXX_ShellView.ShellView.LayoutDocumentPaneControl.RXLed_C.Fill.GradientStops.zcollection.zlistStore.zentry0.Color, "G", 0, 0, True
Aliases.XXX_ShellView.ShellView.LayoutDocumentPaneControl.RXLed_C.Fill.GradientStops.zcollection.zlistStore.zentry0.Color, "R", 0, 255, True
But I don't see how to check the AND of those conditions. Again, I am new to Keyword Tests, but there has to be a way to do this, right?
Solved! Go to Solution.
Hi @betty1,
Explore your control in the Object Browser - perhaps it provides a native property (like, Background color or Color) that you can call from script.
If this doesn't help, take a look at the following KB article:
Also, I've found several threads with a similar question:
I hope it helps.
Hi,
I am not sure that I got the question...
Are you looking for how to check that the button's background is red and green and yellow at the same time?
Anyway, I think that you should look at the Run Code Snippet keyword operation (or Run Script Routine one).
I apologize for being unclear. I am simply trying to detect the color of a button on my WPF GUI. For example, if the following checkpoints all pass, the color is YELLOW (the ..X replaces the long object path)
Property Checkpoint 1
..X.RXLed_C.Fill.GradientStops.zcollection.zlistStore.zentry0.Color, "B", cmpEqual, 0..
Property Checkpoint 2:
..X.RXLed_C.Fill.GradientStops.zcollection.zlistStore.zentry0.Color, "G", cmpEqual, 255...
Property Checkpoint 3:
..X.RXLed_C.Fill.GradientStops.zcollection.zlistStore.zentry0.Color, "R", cmpEqual, 255..
These will each fail individually if they evaluate to False, but I was looking for a way to evaluate all 3 in the same step or better yet to get the 3 object properties and then I can manipulate them with an IF-Then.
I could not find a way to get those particular properties. I am very new to TestComplete, so I just assumed there is an easier way and I haven't found it yet. Thanks for the help.
Hi @betty1,
Explore your control in the Object Browser - perhaps it provides a native property (like, Background color or Color) that you can call from script.
If this doesn't help, take a look at the following KB article:
Also, I've found several threads with a similar question:
I hope it helps.
Subject | Author | Latest Post |
---|---|---|