Select text based on the color

Hi,

I need to select a text from the list box.

The item selected will have white color text with blue background and the item that is not selected will have black color text with white background color.

I need to verify whether the item is selected already. If not selected already, i should select it.

Do we have anything to select the text based on the color

i tried the following code. but it selects text with both the colors black and white. need your suggestions

click text: FieldValue, textColor:"black"

Comments

  • The easiest way to do this is going to be with a captured image. This will verify the state of the text. You could create an image collection containing images of the text in both states, and then depending on which image in the collection is found, you could execute a different action, to select it or not.
    To read about how to create an image collection please see this page: http://docs.testplant.com/?q=content/creating-image-collection

    The code you said you tried is not going to work, because you are using a TIG (Text Image Generator) parameter with an OCR (Optical Character Recognition) search. You can specify to use Contrast, and also set a ContrastColor with the OCR search, but this is to help it eliminate anti-aliasing in its search, and does not function the same way as the TIG setting. Feel free to play around with these settings and see which works best for you in your situation. You can read more about using the OCR here: http://docs.testplant.com/?q=content/working-ocr

    If you have further questions on this, please feel free to write in to TestPlant support with your question and we'll help you work on specifics related to your situation. Thanks!
Sign In or Register to comment.