Forum Discussion

Mk1's avatar
Mk1
Occasional Contributor
8 years ago

waiting until the control is activated when sending keys

var bankName = genIdentPath;
var tempbankName = context1.get("bankName");
if((aqString.GetLength(tempbankName) != null)) {
b = bankName.PwcAutoComplete("p_bank_codeCoB").TextInput(0);
if(b.Exists) {
 b.Keys(tempbankName);
}
} else {
Log.Message("");
}

 

Example 2


//select branch name
var branchName = genIdentPath;
var tempbranchName = context1.get("branchName");
if((aqString.GetLength(tempbranchName) != null)) {
branchName.PwcAutoComplete("p_branch_codeCoB").TextInput(0).Keys(tempbranchName);
} else {
Log.Message("");
}

 

Execution stops and spend 10-15 seconds with the following message "waiting until the control is activated"

This Controls are picked up as TextInput than ComboBox

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Just a possible idea...

    What happens if you manually typing fast in the control? Does some delay occurs?

    My guess, based on the fact that the control looks like a combo-box, is that when you start typing, some ajax request is sent to the server asking for the filtered data been suggested and the input into the field is postponed until the response is obtained from the server and processed on the client (web page).

    If this is the case and you are not interested in the suggested data, you may try to assign data to the control directly via either the .SetText() method, or via the .Value property or whatever else this given control supports and then (optionally, if needed) send something like .Keys("[Enter]") to emulate as if the user pressed some keyboard key and trigger script linked to the control.

    • Mk1's avatar
      Mk1
      Occasional Contributor

      Hi,

       

      .Keys("[Enter]") also triggers the "waiting until the control is activated", .SetText() is not part of the actions listed for that control.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        What does TestComplete "see" when you record actually interacting with the drop down control?  Could it be more efficient to work with that rather than with a keyboard interaction?

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    My best guess on this is that something about your TextInput control prevents interaction until it has been clicked on.  Try starting with something like (in your first example) b.Click(); followed by the Keys method.  Give this a try and see what happens.

    • Mk1's avatar
      Mk1
      Occasional Contributor

      Hi Robert,

       

      I did that, funny enough the click is Instant but moving to the next line it still takes time to enter the data