DoubleClick command can not work at one specific image

I am trapped in a weird “DoubleClickAny” command. All the other DoubleClick command can work correctly except one in a script. Here are my code snippet:

DragAndDrop “InitialComponentModeling/tx_PaymentArrangementsStart”,“InitialComponentModeling/tx_PaymentArrangementsEnd”
DoubleClickAny “li_ComponentPrototype_h”
Click “InitialComponentModeling/ic_DependsOn”
click “bt_Finish”

The expected process is
when doubleclick on image “li_ComponentPrototype_h”, a new window prompted up, which shows the image “InitialComponentModeling/ic_DependsOn”.

The actual result is
The exception thrown out as image "“InitialComponentModeling/ic_DependsOn” can not be found. So, I think image “li_ComponentPrototype_h” has been recognized. But DoubleClick command can not work. Per my observation on the replay, it should be the problem on doubleclick since I didn’t see the prompted window.

My Attempts:

  1. I guess it is timing problem because when select the failed line and click the Run Selection button in the Script Editor, doubleclick command works well. So, I tried the following methods:
  2. Add Wait command:
    Wait 15.0
  3. Add WaitFor command:
    WaitFor 15.0 “li_ComponentPrototype_h”
  4. Add a if/then:
    if ImageFound(“li_ComponentPrototype_h”) then
    DoubleClick “li_ComponentPrototype_h”
    end if
  5. change the Run Option in Preference:
    Here are my configuration parameters in running:
    remoteWorkInterval = 5.0
    StandardImageTolerance = 45
    NextKeyDelay = 0.08

But of no avail at all!

What’s wrong with my script?

If I understand correctly, what you’re saying is that the DoubleClick “li_ComponentPrototype_h” command is executed by Eggplant, but the window that should appear following the doubleClick is not shown. The fact that you can run the doubleClick command successfully after the script fails definitely suggests that there is a timing problem as you suspect.

However, since you’ve already tried several things to make the script wait after the DragAndDrop before performing the DoubleClick, I wonder if it might be something else. One possibility is that you may have pressed a modifier key at some point earlier in the script and forgotten to release it. In that case instead of doing a normal DoubleClick, your script may be doing a Control-DoubleClick or Shift-DoubleClick or whatever, which doesn’t get the desired response from your application. Since Eggplant automatically releases all of these modifiers at the end of a script run, your later Run Selection wouldn’t have the same problem.

So look for any TypeText commands using controlDown, shiftDown, etc. or their old escape-sequence equivalents ("\c", “\s”, etc.), and let us know if that’s the problem.

Hi SenseTalkDoug,

Thanks very much! You got my point :slight_smile:

I did find there is a “\c” modifier exactly before the failed snippet.


Click “InitialComponentModeling/tx_RawNotes”
TypeText “\ca\C”
TypeText “An order has payment arrangements and delivery details”

But since there is also a “\C”, I think the modifier “ctrl” key is up and released. Also the next lines except the “doubleclick” can go on without error.

Do you think I should update my script as below to have a try?
TypeText ContrlKey & “a”
KeyUp AllModifierKeys

You can certainly give that a try, although what you showed of your script looks fine. KeyUp allModifierKeys (or KeyUp allKeys) should release anything else that might have been left down besides that control-key press, so give it a try and see if it helps.

If it turns out that it’s not a modifier key problem then we may want to try once more to see if it could be a timing issue. Timing issues often occur at a point where the application under test needs to do a little processing, like opening a new window. But you said the window isn’t coming up at all, which tells us that the doubleClick event isn’t being processed by the SUT. Waiting a second or two before the doubleClick might help but it sounds like you tried that.

You may want to try adjusting the doubleClickDelay and maybe even the mouseClickDelay:

set the mouseClickDelay to 0.03
set the doubleClickDelay to 0.02

The mouseClickDelay is the length of time that Eggplant waits between sending a mouse down event and the matching mouse up event for a mouse click. The doubleClickDelay is the time between the two clicks. The default values for these settings work the vast majority of the time on most systems, but depending on the system you’re controlling, your network, and so on, it’s possible that you may need to adjust them.

If that’s not it, then we’ll have to dig a little deeper. What SUT are you running against, and what VNC server are you running there?

Hi SenseTalkDoug,

I modified my scripts as below. But “DoubleClick” still can’t work. :frowning:

Click “tx_RawNotes”
TypeText ContrlKey & “a”
KeyUp AllModifierKeys
TypeText “An order has payment arrangements and delivery details”
DragAndDrop “tx_PaymentArrangementsStart”,“tx_PaymentArrangementsEnd”
Set the mouseClickDelay to 0.03
set the mousedoubleClickDelay to 0.02
DoubleClickAny “li_ComponentPrototype_h”
Click “ic_DependsOn”
click “bt_Finish”

My SUT is Windows XP plus Eclipse platform. VNC server is vnc-E4_4_2-x86_x64_win32.

The strange point is that the immediately following code have almost the same operations as the above snippet, which also having this line:
DoubleClickAny “li_ComponentPrototype_h”.
I changed the failed “doubleclick” line to workaround this problem, at this time, the immediately following “doubleclick” can work correctly!

Any other suggestion? Thanks.

It sounds like the window that ic_DependsOn is in could either be slow appearing or could be opening behind something? In any case, I’d do a try catch around a waitfor ic_DependsOn, the click ic_DependsOn, and in the catch block (if ic_DependsOn didn’t appear), repeat the doubleclick li_ComponentPrototype_h.

DragAndDrop “InitialComponentModeling/tx_PaymentArrangementsStart”,“InitialComponentModeling/tx_PaymentArrangementsEnd”
DoubleClickAny “li_ComponentPrototype_h”

repeat 3
try
waitfor 15, “InitialComponentModeling/ic_DependsOn”
Click “InitialComponentModeling/ic_DependsOn”
exit repeat
catch
DoubleClickAny “li_ComponentPrototype_h”
end try
end repeat

click “bt_Finish”

Hi viztester,

Thanks very much for your help.

This “repeat” method DOES work!!! Anyway, per my observation, the “Doubleclick” command always fails at the first time, and works at the second time.

It is a little strange. I am still puzzling about why it behaves like this.