Hello.
We are evaluating Macro Scheduler in order to use it for GUI testing in VB .Net WinForms applications.
We are trying to get the warning text that appears in a text box when the validation of the fields in a form fails.
We are using the GetTextInRect command, but it seems that the first call doesn't work properly: sometimes it gets the text, sometimes it doesn't.
The solution was to made a first call in the script which result is discarded, so next calls work as expected.
Can this be a bug?
First GetTextInRect invocation doesn't work
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Sometimes you need to use these commands in a loop (as the text capture example script does). The reason is that they listen to the TextOut commands called by the application that writes the text out to the screen and you can view these rather like a broadcast. If the system or the app is busy at the exact time you call the GetText.. function the app may not be talking. A nanosecond later and it is.
So sometimes it's worth doing something like:
So sometimes it's worth doing something like:
Code: Select all
GetTextReset
Let>gtRes={""}
While>gtRes={""}
GetTextInRect>10,10,20,20,gtRes
Wait>0.02
EndWhile
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?