Is there anyway to identify the background and font color in Testcomplete?

1.3k Views Asked by At

Can anyone tell me if there is a way in Testcomplete to identify background and font color.I am using jscript and mine is a WPF application.I can't find any property to identify color.

Thanks!

1

There are 1 best solutions below

0
On BEST ANSWER

TestComplete provides access to all native properties and methods of objects in a WPF application. This means that to achieve your task, you can use the same properties or methods as if you are doing this within the code of the application itself. For a common object in a WPF application, the properties you are interested in are Background and Foreground.

var obj = ...WPFObject(...)
var fColor = obj.Foreground.Color;
Log.Message("Text color: R=" + fColor.R + ", G=" + fColor.G + ", B=" + fColor.B);

var bColor = obj.Background.Color;
Log.Message("Back color: R=" + bColor.R + ", G=" + bColor.G + ", B=" + bColor.B);