Contributions
Re: Problem with using arrow functions
Thanks for the hint. I did try changing it to let instead of const. Same error. But it worked if I changed it to var. It looks like I wouldn't need a function to access variables in another file. I can just declare them as var. I hope there wouldn't be other side effects.20Views0likes1CommentProblem with using arrow functions
Dear community, am having bit of an issue using arrow function defined in another file. Code snippet is below. Looking forward to any hints. Test1.JS ------------- const str = 'xyz'; const getStr = () => str; Test2.JS ------------- //USEUNIT Test1 function test() { Log.Message(Test1.getStr()); } I get an error at the statement where Test1.getStr() is called. JavaScript runtime error. TypeError: Test1.getStr is not a function If I modify Test1.JS to the below lines, it then starts working. const str = 'xyz'; getStr = () => str; //notice that I have removed const Any idea what am missing? Did I hit a limitation in TestComplete? BTW, if the arrow function and the caller are in the same JS file, it works with no issues. Best Regards, MadhuSolved47Views0likes3CommentsMigrate from TestComplete v14 to v15, ES5 to ES6
Dear TestComplete Users, Am trying to move from v14 to v15 and start using ES6 instead of ES5. I have a question which may be obvious to you, but am unable to work around. Looking forward to suggestions. I installed v15 and tried a sample script to confirm it supports ES6. It does! See picture below. Next I opened a project that always worked well in v14. It worked in v15 too. But when I try to run the same code in the picture above in a new or existing script, it doesn't work. What am I missing? Is there a project setting? If you have other experiences moving to ES6, please do share.Solved393Views1like2Comments- 12 months agoPlace TestComplete QuestionsTestComplete Questions198Views0likes0Comments
Switch off logging of events
Dear Community, I have a script that measures performance of a command by waiting for GPU usage of the process to get to zero. I have copied the function that gets me the GPU usage below. Every Send request on the aqHttpRequest makes two entries in the log file as you can see in the picture. I suspect logging itself takes time and skews my numbers. Is there a way to instruct TestComplete to NOT log these events? Thanks in advance! Madhu function getGPUUsage() { var aqHttpRequest = aqHttp.CreateGetRequest('http://localhost:5000/getGPUUsage?pid='+Sys.Process("xyz").Id); var aqHttpResponse = aqHttpRequest.Send(); if (!aqHttpResponse) { // Read the response data return aqHttpResponse.Text; } }Solved215Views0likes1CommentRe: GPU Usage
function getGPUUsage() { var perfCounter = Sys.OleObject("PerformanceCounter"); perfCounter.CategoryName = "GPU Engine"; perfCounter.CounterName = "Utilization Percentage"; perfCounter.InstanceName = "_Total"; for(var i=0;i<10;i++) { Log.Message( perfCounter.NextValue()); aqUtils.Delay(1000); } } I tried this function as suggested in one of the search results, but it gives an error at the first line. JScript runtime error. Invalid class string: cannot obtain ClassID. I guess am close. Does anyone know how to get the PerformanceCounter object to work? I do have .net framework runtime 4.8.1.12 months agoPlace TestComplete QuestionsTestComplete Questions305Views0likes0Comments