Blur
9 years agoContributor
Textnode problem
I map the textnode, "This field is required.", then I run the test. Test fails because textnode cannot be found. I check to see what's wrong and the problem is that every time I map the textnode, i...
Hi,
Note: This reply is done assuming you doing "scripting".
I feel some times the objects which are already mapped in TestComplete requires lot of time beacuase of following reasons:
So what I do?
Yes, I don't map objects. I simply do it scripting way.
I do my own "end to end" mapping of those objects in my script. (mapping all parent objects). Thus no need to search object at run time and time gets saved.
Sample code:
//Controls var textBox_Username; var textBox_PasswordBox; var button_Login; //Mapping Function function MapObjectsForLogin() { var LoginPage = Aliases.browser.LoginPage; textBox_Username = LoginPage.Panel("LoginPanel").Panel("LoginPanelBody").Panel("LoginForm").Textbox("username"); textBox_PasswordBox = LoginPage.Panel("LoginPanel").Panel("LoginPanelBody").Panel("LoginForm").Passwordbox("password"); button_Login = LoginPage.Panel("LoginPanel").Panel("LoginPanelBody").Panel("LoginForm").Link("login"); } //Login Sample Function function Login(username, password) { MapObjectsForLogin(); textBox_Username.SetText(username); textBox_PasswordBox.SetText(password); button_Login.Click(); }
Hey prasad,
I just wanted to point out that I did not have a speed problem at all when I was on TC 10. It's the exact same test but on TC 11 it takes 2 minutes to recognize that the object has been mapped. My tests ran with almost no delay on TC 10. I'm definitely going to try the suggestions but just find it odd that going to TC 11 would slow down my tests so much.
did you already update to TC 11.11?
TC 11.10 did have some problems.
jsc wrote:did you already update to TC 11.11?
TC 11.10 did have some problems.
I've upgraded to 11.11 and the frequent TC crashes have stopped but don't see a performance difference.
@william_roe
we still do have some problems with TC 11.11 regarding performance, memory usage (I registered a bug for this),... but nothing can be easily reproduced...
so do you map every panel and cell in your tree?
I think (thought) that cannot work!
- this must be a hell of an effort!
- what do you mean by good templates?
- with such a detailed mapping you should be in trouble if the developers add some random panel somewhere, or am I wrong? with extended find, this is no problem at all.
If you can explain your approach to me, I might improve our own mapping.
I haven't upgraded to 11.11 yet. I didn't see any update other than a FireFox patch. I'll try updating to 11.11 tomorrow.
I also map everything which has worked fine for me but many of my tests fail now because it takes so long for TC 11 to recognize that the objects have been mapped. Hopefully 11.11 will fix some of my issues. Will let you guys know how it goes after the update.
Hi Blur,
Actually I started directly with TestComplete 11 and came up with that.
and its not yet updated 11.11 :smileyindifferent:
And if it could be fixed then it would be really helpful. :smileywink:
And here is small editing in my MapObjectsForLogin function:
Old Code:
//Mapping Function function MapObjectsForLogin() { var LoginPage = Aliases.browser.LoginPage; textBox_Username = LoginPage.Panel("LoginPanel").Panel("LoginPanelBody").Panel("LoginForm").Textbox("username"); textBox_PasswordBox = LoginPage.Panel("LoginPanel").Panel("LoginPanelBody").Panel("LoginForm").Passwordbox("password"); button_Login = LoginPage.Panel("LoginPanel").Panel("LoginPanelBody").Panel("LoginForm").Link("login"); }
Edited code:
/Mapping Function function MapObjectsForLogin() { var LoginForm = Aliases.browser.LoginPage.Panel("LoginPanel").Panel("LoginPanelBody").Panel("LoginForm").Textbox("username"); textBox_Username = LoginForm.FindChild('Name','Textbox("username")', 10); textBox_PasswordBox = LoginForm.FindChild('Name','Passwordbox("password")', 10); button_Login = LoginForm.FindChild('Name','Link("login")', 10); }
Just used FindChild() Method. This will reduce complexity of script.
But Parent object (e.g. here 'LoginForm' and not 'LoginPage') must not be huge. else it will again take lot of time
What I mean is parent object should not contain large no. of child objects (more no. of childs more time will take to load that control)