GetBackgroundColor Function

Class

TextField.

Action

Returns the background color of a text box in terms of RGB values.

Syntax

cColor = GetBackgroundColor()
Variable Description
cColor A record with fields for RGB values. COLOR.

Notes

In some applications the background color of a required text box remains red if a user leaves the text box empty. Being able to detect the background color helps you determine whether or not the application under test is enforcing required text boxes.

Examples

If the background color of the text box is white, the following test case returns {255, 255, 255}, the RGB values for white.

testcase GetColor () appstate none
Print(xTextField.TheSingleLineTextField.GetBackgroundColor()) 

testcase TestBackgroundColor()
// a variable cColor is declared of the predefined type COLOR 
COLOR cColor
// the expected result, cColor, is white
cColor = {255,255,255}
Verify
(Window.TxtFd.GetBackgroundColor(), cColor, "background color")