Ask a Question

waiting until the control is activated when sending keys

Mk1
Occasional Contributor

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

6 REPLIES 6
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.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
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

AlexKaras
Community Hero

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.

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
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
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?


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Mk1
Occasional Contributor

I resorted to recording the interaction then use the code to my script. Its working better in that way.

cancel
Showing results for 
Search instead for 
Did you mean: