Text with inconsistent images as background

Hi,
I wish to know how I can identify text in eggplant where my text is placed on an image.

The Image could be anything. Its keeps on changing.
I have given a simple example below. It becomes more complex than the example as along with the pattern there could be semi transparent images in the background.

That would depend on whether the text is selectable or not.

If the text is selectable you could copy it to the clipboard and get eggPlant to verify it that way. I think the command is put RemoteClipboard(5), the 5 being seconds to wait for clipboard. I usually use it without any seconds.

If that’s an image of some text then you could try using the text&pulsing search type. Look in the “Using eggPlant” from the Download section of the TestPlant site. I’m not sure if that would work for this, would need a more experienced egghead to help you with this one.

This is one situation in which you’re unlikely to be able to reliably script against it. The whole point of this kind of display is usually to defeat any kind of script or automation – if you could successfully detect the text with eggPlant, you’d probably need to log that as a bug against the application.

Hi,
its not a part of my application as in…it not a captcha(The text is proper…with uniform font , font size , and color )
My entire Application has images at the background.

It would be really difficult to come up with any way of scripting against this kind of display. The text is not on the same baseline and the letter spacing is odd. Combine that with the variability of the background and it’s a huge challenge. I can’t think of any good way of handling this particular situation.

Hi I am sorry the last image i uploaded looks like it doesnot have a proper baseline and the character spacing is inconsistent.
Thats not the case.
I am uploading a proper image with out the base line and character spacing issues.

Is it any way I can recogniza these kind of text

Thanks

If you can determine the correct font characteristics, then you might be able to get a match by pulling a color from the background, but you’d need to know the area of the screen in which to look, so if this would work at all, it would only work if the text is consistently displayed in the same area of the screen. (The area can be defined dynamically based on other UI elements, but it would always need to be in the same relationship to those elements, such as below a specific dropdown menu and above an OK button.) So let’s say that you can define the search area like this:

put imageLocation("somePopup") into upperLeft
put imageLocation("someButton") into lowerRight
set the searchRectangle to (upperLeft, lowerRight)

Then you could try getting the background color by sampling just inside the searchRectangle:

put colorAtLocation(upperLeft + (1,1)) into bgText

You might need to check to make sure that the bgText color isn’t white (or whatever color the text itself is supposed to be) and make a loop where you keep moving over a pixel at a time until the color found is not the color of the text (although the effects of antialiasing could really complicate that effort).

I hope this gives you an idea of how to approach scripting this scenario. I still wouldn’t anticipate a lot of success, but this might be worth a try.