by eValid » Fri Dec 17, 2010 12:18 pm
Some times a question comes along that is a real stumper. This is one of those instances. The good news is that we have it resolved. Here is the complete sequence of the thinking involved.
(A) BACKGROUND
To begin with, let's summarize the information we have available to analyze this problem: (1) we do NOT have access to the application; (2) the script fragment shown above was NOT actually recorded "from life" but was hand-scripted; (3) the reporting of what was and wasn't seen on the screen during playback is not complete or seems to be somewhat contradictory; and, (4) we only have a few fragments of the playback event log.
Normally, to diagnose a problem we need access to the application, the complete script, and the complete event log.
(B) DESKTOP WINDOW TITLE ROLE & DWindowSet COMMAND
eValid records where a desktop window was and what its title is with the DWindowSet command. It needs this so that, at playback time, it will "do the right action, on the right window."
When eValid records action on a desktop window that does not have a title, eValid inserts "eValid" as the title, because at playback time you don't want the playback engine to try to find the window that has no title (there may be a lot of them).
Then, at playback time, eValid performs this nice little trick of marking already-checked desktop windows by prepending "<eVPlay>" on the title. After a desktop window is so marked it's title may be "<eVPlay> eValid" as is suggested in this issue.
(C) OTHER DIAGNOSTIC CLUES
Here is the key diagnostic clue to this puzzle.
You will note in the proposed script there are TWO windows, as indicated by the two successive DWindowSet commands, both without a title, that are the same size and are located at exactly the same spot on the desktop (the four numeric parameters).
Which one of them is "on top"? That's important to know because a KeySys command will issue a keystroke to the desktop at a particular location and that keystroke will be interpreted by only ONE of these two windows, the one that is on top. But which one is on top?
(D) DIVERSIONARY SUGGESTIONS
While the author is creative in trying to understand what is going on with a playback that works sometimes and then later doesn't work, that information isn't actually useful.
It would have been better if the intent of the constructed passage was better explained. And, it would have been nice to know WHY the application pops up TWO successive modal dialogs that both have to be dismissed.
The explanation we believe is the correct one was found by, in the end analysis, disregarding most of the explanation. Instead, we just concentrated on what the two successive, identical, DWindowSet commands could be doing?
(E) EXPLANATION: RACE CONDITION CREATED
The two DWindowSet commands create a race condition between two popup desktop windows that lie exactly on top of each other.
eValid evidently finds the first one labeled "eValid" (because it has no title) and then marks it as found and handled by prepending "<eVPlay>" to its title.
But because the two windows are in the identically same location, because system response times are involved, some of the time the WRONG window is getting the transmitted keystroke. That's because the Windows desktop is a unitary resource and only ONE of the two windows can be "on top" at one time, and whichever one that is is the one that receives the keystroke. That's not going to be deterministic.
(F) LESSONS WE LEARNED
We really had to struggle with this question, but the lesson we learned at the end of the day [actually, learned again, to be completely honest] is that in some cases you need to work from understanding what eValid's commands DO first, before trying to compose them to accomplish some purpose for which they were not intended.
(G) RECOMMENDATION
Perform the required window synchronization with a Validate and Synchronize on Screen Rectangle action. Our records show that this was our original recommendation, and we believe if you follow it your script playback will be successful.
_________________
The eValid Team