Forum Discussion

doug_bowen's avatar
doug_bowen
Occasional Contributor
7 years ago

When using TestComplete 12.42, Keys() performs very slowly (up to 30 seconds between keystrokes)

We're evaluating moving from TestCompletre 12.1 to TestComplete 12.42 but we're running into a performance issue.  When executing activeWindow.Keys(), we're seeing a very long time (upwards of 30 seconds) per key stroke.  

Essentially, we launch a command line tool from cmd called loader.exe.  We do this in Figure A below.  You'll notice that we lose control of the window as it becomes a completely different application (from cmd to loader.exe) so we're using ActiveWindow to capture loader.exe then send it keys to sign in.  You'll see how we launch CMD in Figure B.

 

This works perfectly on TestComplete 12.1

 

We have performed our own testing to determine that ActiveWindow is not the issue and that writing directly to Command Prompt is not the issue.  We also have loader.exe mapped and when I call the map loader.wndConsoleWindowClass.Keys() the issue occurs as well (See Figure C).  I have validated that there is not an abnormal delay in the project for keystrokes or events.

 

What are we doing incorrectly?

 

FIGURE A

 

function importFile(pathToTXTFile)
{
windowStyle = 1; //Not minimized. Visible.
waitOnReturn = false; 
zCmd.cmd.SHELL.Run(ProjectSuite.Variables.INSTALLPATH+"\\loader.exe \""+pathToTXTFile+"\"", windowStyle, waitOnReturn);

Delay(3000,"Assigning CMD as Active Window");  
var activeWindow = Sys.Desktop.ActiveWindow();
activeWindow.Keys(ProjectSuite.Variables.USERNAME+"[Enter]"+ProjectSuite.Variables.PASSWORD+"[Enter]"+ProjectSuite.Variables.DATABASE+"[Enter]"); //login into the database
Log.Message("FcLoader is processing: "+pathToTXTFile); 
}


FIGURE B

var cmd = {
SHELL: Sys.OleObject("WScript.Shell"),
command: null, //If you are executing a batch file, this should be the path to the batch file. 

run:function(command)
{
this.setDirectory(command);
output = this.inputCommand(command);
this.logResult(command,output); 
return output; 
}

}


FIGURE C

 

 

var loader = Aliases.FcLoader;                                   
var frmloader = fcLoader.wndConsoleWindowClass;