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...
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:
Mapping of objects is not done "end to end".
i.e. not all parent objects of the required object are mapped. Only few of the parent objects are mapped
Example if required object is "F" and hierarchy is A - B - C - D - E - F.
Then TestComplete may map A - C - F. Not all parent objects
Thus while run time (i.e. at playback time) TestComplete internally tries to implement "FindChild()" to find that object on page. This will certainly take some time, if the requried object is placed way down in the hierarchy.
So what I do?
I don't map objects.
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();
}
I've only been using keyword testing because that's what was taught during the training. For keyword testing, I run into many problems. I've tried not fully mapping the objects but that comes back to bite me later on. If there are two textboxes and I don't map fully map them then TestComplete might see them as the same object. Do you run into that issue with mapping via scripting?
1) do the mapping first! map all the elements needed manually and disable automatic mapping as this will screw your mapping.
2) check the mapping criteria for each item carefully. the criteria has to be unique so that the element will always be found. we use idstr or objectidentifier as often as possible (developers can set the value) or of this is not possible, select a unique label or similar stuff.
3) use extended find for all mapped elements that have you have mapped as in 2) and remove all other stuff in between (like .panel, .cell, .table,...), which can change all the dtime.
I'm mapping it manually but I have been mapping the whole object tree. When deleting the "stuff in between", are you doing that for the alias only or actual mapped objects as well? I'm not too familiar with extended find. It definitely sounds like what I need to do though.
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.