cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to have object repository

SOLVED
Contributor

Re: What is the best way to have object repository

Marsha,

If use 

w=Namemapping.sys.legaclt.FindChild('FullName","*"obType,50)

it is saying object does not support this property or method w

 

Instead of fullname i was using wndclass and gave obtype as edit,button depending on the action. That is also taking lontime. each object is taking about 30 to 70 seconds.

 

 

so in the findchild if we are using fullname what should i give the object type as?

Contributor

Re: What is the best way to have object repository

Marsha,

If use 

w=Namemapping.sys.legaclt.FindChild('FullName","*"obType,50)

it is saying object does not support this property or method w

 

Instead of fullname i was using wndclass and gave obtype as edit,button depending on the action. That is also taking lontime. each object is taking about 30 to 70 seconds.

so in the findchild if we are using fullname what should i give the object type as?

Community Hero

Re: What is the best way to have object repository

You should never use "FullName" as either a property in NameMapping or in a search object.  This triggers TestComplete to default to use the fullname as identification and takes a long time to search things out.

For FindChild, you should use the same type of criteria you would use for NameMapping.  Keep in mind, also, that FindChild DOES do a search... so, you're searching 50 levels down... depending upon how many objects there are in your tree, that's a rather massive search.  You should ALWAYS be as precise as possible in object identification.  And the further down the descendent tree you go before you do your search, the better the performance.

 

So... you said you implemented NameMapping... what you've described in the above code is not EXACTLY what was suggesting.  For that matter, rather than referencing the NameMapping node, you should probably utilze Aliases instead.

There seems to be a pattern of people coming over from other tools (namely UFT/QTP and Selenium) to distrust the built in object repository of the tool.  TestComplete's NameMapping is NOT like those repositories.

Please review the NameMapping documentation and work on identifying your objects.

https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/name-mapping/inde...


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Contributor

Re: What is the best way to have object repository

i looked into the link and changed my code as below

w=namemapping.sys.legaclt.wndLSPANEL3.page32770.FindEX("MappedName","*"&field,30)

 

this is my aliases name 

namemapping.sys.legaclt.wndLSPANEL3.page32770

 

still i see child windows taking time to find the objects.

Community Hero

Re: What is the best way to have object repository

You should not use "MappedName" to find, either.  That's the name of the mapped object... if it's already mapped, there's no need to find it.  

And no, that is not your Alias name... an Alias starts with Aliases.

A find should use non-TestComplete designators (wndCaption, ObjectType, etc) for the search.  

So, since you already have it mapped with something represented by field, you should find the Alias designation and then use something like

 

w=Aliases.legaclt.wndLSPANEL3.page32770.WaitAliasChild(field, 30000)

 


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Contributor

Re: What is the best way to have object repository

with this i tried

w=Aliases.legaclt.wndLSPANEL3.page32770.WaitAliasChild(field, 30000) and when it comes to identify the child window.

  it says non-existance object. after it fails when i highlight the object it is able to highlight. Also when i debug the code and object spy and then run it. it is able to identify the object correctly.

 

Issue happend only with the child window.

Contributor

Re: What is the best way to have object repository

Thankyou. I found the problem. Issue was with refresh after i added its working fine.

Community Leader

Re: What is the best way to have object repository

Goodness that Findall is going to impact your performance.

 

As @Marsha_R suggests, use FindChild if you know the exact value of a property for a child object.  What your current code is doing is picking up all child objects in all the leaves in all the sub-nodes of your object hierarchy to a depth of 30 sub-nodes.  Because you are using the wildcard "*", it will be searching absolutely all the children.  If you have such a large object tree as your original post suggests, that will take forever.  If the child you are looking for isn't a direct child, you could consider using FindChild, but with less depth to it - you may need to experiment on the correct depth.

 

Perhaps something like

w=namemapping.sys.legaclt.FindChild('MappedName',mappedname,5);
if(w.Exists)
{
Log.Message("Object Exists");
else
{
Log.Message("Object doesn't exist");
}

That should speed up the find process.  Also, the FindChild will ALWAYS return an object.  If it doesn't find anything that matches your search criteria, the object will just have an Exists property of false.

 

 

 


-------------------------------------------------
Standard syntax disclaimers apply
Regards,
Contributor

Re: What is the best way to have object repository

Thanks Rudolf

I used waitaliasechild and also moved the child objects under the parent in aliases window in name mapping. The execution is fast now.

New Here?
Join us and watch the welcome video:
Watch the New Interview
APITestingMistake#2
Top Kudoed Authors