Contributions
TestComplete slowness (performance hit) with chrome while using FindChildByXPath
Test Environment: Windows 7 and Windows 2008 Server, Chrome 26, TestComplete 9.3 (couldn’t use latest testcompete and chrome version as we don’t’ have license of latest TC yet L) Web Application developed using technologies: MS .Net, MVC, JSon Description: On a web page I have two text boxes, labeled as Courier and Queue, I couldn’t NameMap them as no unique property (not even unique id) is there to map, hence I have to use FindChildByXPath to recognize them as web page element objects. When I execute my following script, TestComplete is taking on average 3 to 4 seconds on FindChildByXPath statement and unfortunately 10 to 11 seconds when it comes to Key in data to these objects(textboxes). I could not understand that when TC has recognized the objects, why it is taking too much time again when it comes to performing operations on these objects. If those controls are once recognized and assigned to objects, there is no point again taking that much time as it will kill the purpose of automation, operation can be performed manually faster than that. Also observed that when I try to object spy these text boxes, TestComplete hangs and computer CPU utilization reaches to 100%. Any help in this regard is highly appreciated Code Snippet: var StopWatch; StopWatch = HISUtils.StopWatch; StopWatch.Start(); var objCourier=page.FindChildByXPath(“//*[@id='divCourierSearchTextBox']//input[@type='text']”, false); StopWatch.Stop(); Log.Message("Time taken to recognize Courier object: " + StopWatch.ToString());//takes 3 to 4 secs StopWatch.Reset(); StopWatch.Start(); var objQueue=page.FindChildByXPath(“//*[@id='divQueueSearchTextBox']//input[@type='text']”, false); StopWatch.Stop(); Log.Message("Time taken to recognize Queue object: " + StopWatch.ToString());//takes 3 to 4 secs StopWatch.Reset(); StopWatch.Start(); if (objCourier != null && objQueue != null) { StopWatch.Stop(); Log.Message("Time taken to check if objects are not null: " + StopWatch.ToString());//takes no time, very quick StopWatch.Reset(); StopWatch.Start(); // If the elements were found, enter data objCourier.Keys(strCourier+"[Enter]"); StopWatch.Stop(); Log.Message("Time taken to key in courier value: " + StopWatch.ToString());//takes 10 to 11 secs page.article.tbParcelNumber.Keys(parcelNo); Log.Message(parcelNo); StopWatch.Reset(); StopWatch.Start(); objQueue.Keys(strQueue+"[Enter]"); StopWatch.Stop(); Log.Message("Time taken to key in Queue value: " + StopWatch.ToString());//takes 9 to 10 secs2.1KViews0likes3CommentsRe: Checking for existence of a Script Unit and functions/subs defined in it
Thank you Tanya, Once I thought there could not be any solution, can you please have a look at follwoing requests Provide a bit of commentry especially on code before "While" block, so that I understand what is going on Will this work for Script Unit referenced into a Project? I am translating you given Code into VBScript as follows but at bold line TC is flagging error, can you please help to fix it? Function FunctionExists(UnitName, FunctionName) var oTC = Sys.OleObject("TestComplete.TestCompleteApplication") var strProjectName = /\\([^\\]+).mds$/.exec(Project.FileName)[1] var colFunctions = oTC.Integration.ProjectRoutinesIterator(strProjectName) colFunctions.Reset() var oFunc while (colFunctions.HasNext()) oFunc = colFunctions.Next if ((oFunc.UnitName = UnitName) && (oFunc.Name = FunctionName)) then FunctionExists= true end if Wend FunctionExists= false End Function1.8KViews0likes0CommentsChecking for existence of a Script Unit and functions/subs defined in it
Suppose I am getteing name of Script Unit and any function defined in it as input from an external data source, if I want to determine, whether this particular Script Unit and function is part of current TestComplete project or not.... is it possible via any scripting techinque (any TestComplet feature or language feature) I want to acheive something like below Example: --- strScriptUnit=get name of function from excel test data sheet strFunction= get name of function from excel test data sheet IF strScriptUnit belongs to current Project and strFunction bleongs to strScriptUnit THEN Runner.CallMethod(strScriptUnit &"."&strFunction,[parmlist...]) ELSE Log.Message "Non existent Script Unit or Function" END IF ---- Can we achieve Bold check applied in Pseude Code? thanksSolved3.7KViews0likes5CommentsRe: Significance and utilization of "Sender" parameter to GeneralEvents_OnStopTest(Sender)
I am aware of the documentation link given above, what i am specifically interested in is particular usage of "Sender" parameter with the help of any exmaple, i.e. how can we use "Sender" inside the body ofGeneralEvents_OnStopTest1.9KViews0likes0Comments- 480Views0likes0Comments
Copying a mapped object
I have to copy the NameMapping of a mapped object and all its child objects under a different mapped object. For exmaple i have Parent1.ChildObject1 which have further mapped child objects, now i want to copy the NameMapping of ChildObject1 as is to a different parent object say Parent2. Is it possible if yes then how? Help much appreciated in advance.22KViews0likes2Comments