Hot Spot Off Screen For Image Exception

HI,
When I use the following code ,

Wait Until AnyImageFound (Text:“Name:”, TextFont:“LucidaGrande”, TextSize:“10”,TextColor:(0,0,0),TextBackgroundColor:(232,232,232))

or

Wait Until ImageFound (Text:“Name:”, TextFont:“LucidaGrande”, TextSize:“10”,TextColor:(0,0,0),TextBackgroundColor:(232,232,232))

Iam getting Exception like : Exception Text: Name: Hot Spot Off Screen For Image “Text: Name:”

My Functionality is when i open a window say “Window1” My script should wait until it finds a text image :"Name: " on the window screen,

Can any one please help me out to resolve this.
Please feel free to as if you require further more information from my end.

Thanks In Advance.

You can use a WaitFor in situations like these:


WaitFor 30 seconds, (Text:"Name:", TextFont:"LucidaGrande", TextSize:"10",TextColor:(0,0,0),TextBackgroundColor:(232,232,232)) 

The timeout of 30 seconds can be less or more - basically any absolute value that you feel a real person should have to wait. Eggplant will continually examine the screen for the existence of your text within this period, so should Eggplant find the text before the time out period, it will immediately continue on to the next step in your script.

I’m not sure about this “Hot Spot Off Screen” exception. What happens if you run the command


put imageLocation(Text:"Name:", TextFont:"LucidaGrande", TextSize:"10",TextColor:(0,0,0),TextBackgroundColor:(232,232,232))

when the “Name” text is on the screen. And what is happening during your wait? Is the window zooming into the screen or anything? Any other information you can provide would be useful.

Hi ,

When I run the wait until or Waitfor Commands for a text image i.e (WaitFor 300 seconds,(Text:“Name:”, TextFont:“LucidaGrande”, TextSize:“10”,TextColor:(0,0,0),TextBackgroundColor:(232,232,232))

Or
Wait Until(Text:“Name:”, TextFont:“LucidaGrande”, TextSize:“10”,TextColor:(0,0,0),TextBackgroundColor:(232,232,232))

My script is not waiting till the text image appears on the screen , it throws an exception Hot Spot Off Screen For Image Exception

Log of the above script is

Sat, 18/10/08 11:07:49 AM START Running Selection from Create Miniteam.script

11:07:49 Start handler 1: create_miniteam
if AnyImageFound((Text:“File”, TextSize:“14”,TextFont:“LucidaGrande”, TextColor:(0,0,0),TextBackgroundColor:(232,232,232))) then
Sat, 18/10/08 11:07:50 AM anyimagefound Text: File found at (124, 10)
Click FoundImageLocation()
Sat, 18/10/08 11:07:50 AM click at (124, 10)
If ImageFound((Text:“Sign Out”, TextSize:“14”,TextFont:“LucidaGrande”, TextColor:(0,0,0),TextBackgroundColor:(232,232,232))) then
Sat, 18/10/08 11:07:50 AM imagefound Text: Sign Out found at (153, 204)
log"User Signed In "
Sat, 18/10/08 11:07:50 AM log User Signed In
If ImageFound((Text:“New”, TextSize:“14”,TextFont:“LucidaGrande”, TextColor:(0,0,0),TextBackgroundColor:(232,232,232))) then
Sat, 18/10/08 11:07:50 AM imagefound Text: New found at (139, 35)
Click FoundImageLocation()
Sat, 18/10/08 11:07:51 AM click at (139, 35)
If ImageFound((Text:“Miniteam…”, TextSize:“14”,TextFont:“LucidaGrande”, TextColor:(0,0,0),TextBackgroundColor:(232,232,232))) then
Sat, 18/10/08 11:07:51 AM imagefound Text: Miniteam… found at (430, 79)
Click FoundImageLocation()
Sat, 18/10/08 11:07:51 AM click at (430, 79)
WaitFor 300 seconds,(Text:“Name:”, TextFont:“LucidaGrande”, TextSize:“10”,TextColor:(0,0,0),TextBackgroundColor:(232,232,232))
Sat, 18/10/08 11:07:51 AM waitfor Text: Name: found at (943, 368)
Click (Text:“Name:”, TextFont:“LucidaGrande”, TextSize:“10”,TextColor:(0,0,0),TextBackgroundColor:(232,232,232),hotspot:(150,10))
Sat, 18/10/08 11:07:52 AM Exception Text: Name: Hot Spot Off Screen For Image “Text: Name:”
<<< 11:07:52 End handler 1: create_miniteam (aborted)
Selection Failed in 0:00:02 Hot Spot Off Screen click Error - Hot Spot Off Screen For Image “Text: Name:”

Please let me know how to make the script execution to wait until the text image appears on the screen.

Text Image is ---- (Text:“Name:”, TextFont:“LucidaGrande”, TextSize:“10”,TextColor:(0,0,0),TextBackgroundColor:(232,232,232))

Thanks In Advance.

Hi Matt,

Thanks for your reply,

I am not sure i can use this put imageLocation function , The reason being when i open the form , it will take some time to show all screen layouts, hence my Text Image also takes some time to appear, so i need to wait my script execution till my text image appears.

Please let me know how to wait script execution if we use text images.

Thanks…

What I meant was for you to just manually put your application into the state where the “Name” text is visible and then run just the put ImageLocation command to see what happens. I’m trying to determine whether your click command is catching the app in some intermediate state and if the command will work at all.

I can see from the log that the image is being found at coordinates (943, 368). What is the resolution of the SUT screen? Are those coordinates close to the edge of the screen?

As for how to wait for the image to appear, see EPJoK’s post above. The WaitFor command is what you need. You can WaitFor the text and then click on the found location with code like the following:


WaitFor 30 seconds, (Text:"Name:", TextFont:"LucidaGrande", TextSize:"10",TextColor:(0,0,0),TextBackgroundColor:(232,232,232)) 
Click FoundImageLocation()