Contributions
Re: Performance issues after converting JScript project to JavaScript in TC 12
I am seeing the same issue as well. I am in the process of converting our codebase to JavaScript but our smoketest performance has increased by 20min! I have not been able to find a solution - have you?2KViews0likes5Commentslistener could not hand off client connection after JavaScript conversion
We use successive database queries to be able to manipulate our app since TestComplete is not able to recognize certain grid objects(completely separate issue) After about 20 successful calls back and forth I receive this error : Error OraOLEDB ORA-12518: TNS:listener could not hand off client connection var connectionObject = ADO.CreateConnection(); connectionObject.connectionString = "Provider=Oracle Provider for OLE DB;" + "Password="+ProjectSuite.Variables.FCPASSWORD + ";Persist Security Info=True;" + "User ID="+ProjectSuite.Variables.FCUSERNAME + ";Data Source="+ProjectSuite.Variables.DATABASE; connectionObject.Open(); //THIS IS WHERE THE ERROR IS GENERATED var recordSet = Sys.OleObject("ADODB.Recordset"); recordSet.Open("select meter_class from fc_meter_class order by meter_class asc", connectionObject, 3); // 3 indicates static cursor Delay(200, "Building list of Meter Classs in memory"); classArray = recordSet.GetString(); recordSet.Close(); I also call connectionObject.Close() at the end of this function.... The above code has been modified based on SmartBears user documentation for JavaScript, here is what works flawlessly with JScript: var connectionObject = new ActiveXObject("ADODB.Connection"); var connectionString = "Provider=Oracle Provider for OLE DB;" + "Password="+ProjectSuite.Variables.FCPASSWORD + ";Persist Security Info=True;" + "User ID="+ProjectSuite.Variables.FCUSERNAME + ";Data Source="+ProjectSuite.Variables.DATABASE; connectionObject.Open(connectionString); var recordSet = new ActiveXObject("ADODB.Recordset"); recordSet.Open("select meter_class from fc_meter_class order by meter_class asc", connectionObject, 3); // 3 indicates static cursor Delay(200, "Building list of Meter Classs in memory"); classArray = recordSet.GetString(); recordSet.Close();893Views0likes1CommentRe: Why is Javascript ReadLine() performance 100000% slower than Jscript?
I have tried using both methods - aqFile and the above. The performance is atrocious. Here is our Jscript code - var pathToTXT = ProjectSuite.Variables.FCINSTALLPATH+"\\Setup\\__createdb.log"; var logMethod = "Warning"; if(!aqFile.Exists(pathToTXT)) { Log.Error(pathToTXT+" does not exist."); return; } else var openTXT = aqFile.OpenTextFile(pathToTXT, aqFile.faReadWrite, aqFile.ctANSI); //open createdb text file var lineToBeRead; var compare; var secureRole; var counter = 0; openTXT.Cursor = 0; while(!openTXT.IsEndOfFile()) { lineToBeRead = openTXT.ReadLine(); compare = lineToBeRead.search("ORA-"); if(compare > -1) { secureRole = lineToBeRead.search("28405"); if(secureRole == -1) //This will ignore thie specific errror { if(logMethod == "Errors" || logMethod == "errors") Log.Error("Line " + counter +": " + lineToBeRead); if(logMethod == "Warnings" || logMethod == "warnings") Log.Warning("Line " + counter +": " + lineToBeRead); } else { Log.Message("Line " + counter +": " + lineToBeRead); } } counter++; } openTXT.Close();1.6KViews0likes5CommentsWhy is Javascript ReadLine() performance 100000% slower than Jscript?
I am in the process of converting our SmokeTest to javascript and we have a db error log we parse for Ora-errors. Before the conversion to javascript - this process took 12 seconds. Now using SmartBear's own documentation the same function is taking 3min+. Am I doing something wrong?? let counter = 0; let logMethod = "Warning"; const ForReading = 1; let FSObject = Sys.OleObject("Scripting.FileSystemObject"); let file = FSObject.OpenTextFile(ProjectSuite.Variables.FCINSTALLPATH+"\\Setup\\__createdb.log", ForReading); while(! file.AtEndOfStream) { let lineToBeRead = file.ReadLine(); compare = lineToBeRead.search("ORA-"); if(compare > -1) { secureRole = lineToBeRead.search("28405"); if(secureRole == -1) { if(logMethod == "Errors" || logMethod == "errors") Log.Error("Line " + counter +": " + lineToBeRead); if(logMethod == "Warnings" || logMethod == "warnings") Log.Warning("Line " + counter +": " + lineToBeRead); } else { Log.Message("Line " + counter +": " + lineToBeRead); } } counter++; } file.Close();1.6KViews0likes7Comments