Testcomplete is slow to performs basics operations.
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Testcomplete is slow to performs basics operations.
Hi everyone !
I have an annoying issue with TC since the last update. (15.47.4.7 x64).
Basics operations like Click(), obj.Text = "some string" etc... take a long time to execute. About 3 to 4 seconds.
For example I have a very simple login page.
it's just a td/tr with some elements (two input, one button)
Searching accross this dom, is really fast for TC. Nearly instantaneous.
this is the code (javascript) :
in this code almost all lines are executing fast except : input1.Text = login, input2.Text = password and button.Click().
Before the update (I don't remember the version, maybe 15.41) this code took less than a second to execute, now it take 8 seconds in the best case.
function login(login = Project.Variables.login, password = Project.Variables.password){
var page = Aliases.browser.pageLogin;
var input1 = page.Find("ObjectIdentifier", "input_1", 7, false);
var input2 = page.Find("ObjectIdentifier", "input_2", 7, false);
var button = page.Find("ObjectType","SubmitButton", 7, false);
if(input1.Exists){
input1.Text = login;
}else{
Log.Error("input1 not found");
return false;
}
if(input2.Exists){
input2.Text = password;
}else{
Log.Error("input2 not found");
return false;
}
if(button.Exists){
button.Click();
Log.Message("Connection ok");
return true;
}else{
Log.Error("button not found");
return false;
}
}
I don't understand why the operations is so long. Thx.
Solved! Go to Solution.
- Labels:
-
Script Tests
-
Web Testing
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Usually when this happens, I close TC and clear the browser cache. I also ensure the browser name mapping is correctly defined. Sometimes, using Object Spy tool slows down too. Not sure what the exact issue is.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've done all that before, no improvement.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have found a workaround.
This is a total nonsense but... it works.
So, I'm searching for an object in the standard way with properties/values (obj.Find or obj.FindAll) then, I extract the full xpath of the object and searching it again via xpath (FindElement).
In this way, the subsequent operations on the object (like Click(), HoverMouse() etc...) are instantaneous. This double search slow down my scripts routines but overall, it works much better than the standard way alone. It seems that when we do an operation like Click(), TC search the object again instead of accessing it directly (at this point TC is really slow). Via xpath, we have no search, so it's always instantaneous.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've ended running the same code, using TC 15.48.6.7 x64 on our web application which also has a login in page, and it works fine.
The only delay, is the website being redirected to a login page.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yeah I know. the code is really simple and should work without issue, but, it's not the case in my environment. TC struggle when it has to execute some functions like Click().
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are still having issues, then log a support call https://support.smartbear.com/testcomplete/message/. Hopefully, that should get your issue resolved quickly.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes the issue is still there :
look, 11s to set the first input ! 7s for the second and the button...
With my weird workaround (double search) the time is acceptable
2s for the first input, and less than 1s for the others.
I don't think Smartbear can really help. I can't provide access to the app (confidential and on an independent network) nor video or the "complete" code I'm using. (the code in this thread is a simplified one but the issue are exactly the same).
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's is strange!
I guess it will be difficult to diagnose if they can't gain access. I can’t think of any other solutions.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
that's all I can provide. The code isn't clean and redundant but doesn't matter.
As you can see, each line works as it should, but when TC sets the text or clicks the button, it takes a long time. At this point, "elementHTML" is already found and visible on the screen.
So it looks like the TC engine has a bug.
