cancel
Showing results for 
Search instead for 
Did you mean: 

Field Dichotomy: Found by One Script; Unusable by Other Script

Highlighted
Occasional Contributor

Field Dichotomy: Found by One Script; Unusable by Other Script

Testing a screen that takes user input, I have a field that I'll call objName that is called by two different scripts.  It worked in the first script for a long time but, when it stopped working, I recorded another script to test the same field.  TestComplete assigned it the same name ("objName"), and I am able to re-run this script.



However, when I try to run the first script, into which I copied the object from the second script, the first script still cannot find objName, even with a blinking cursor in it, and even though I can type text into it while the script is waiting and failing.  Advice appreciated...
6 REPLIES 6
Highlighted
Staff

RE: Field Dichotomy: Found by One Script; Unusable by Other Script

Are you using NameMapping? If you are, then you should compare mapped object properties in the old and new tests.
Highlighted
Occasional Contributor

RE: Field Dichotomy: Found by One Script; Unusable by Other Script

NameMapping is being used, but I'm not doing anything explicitly to create entries within it.  All I know is that controls, etc., that used to work now fail with no changes to scripts - or anything else for that matter.
Highlighted
Staff

RE: Field Dichotomy: Found by One Script; Unusable by Other Script

NameMapping contains information needed to find the tested object: its position in the application objects tree and properties that uniquely identify the object among its siblings. It seems that something have been changed in the tested application that is why existing NameMapping information is not valid anymore. When you recorded new script TestComplete automatically collected new NameMapping information. Even if the script is the same, the NameMapping information is different and you need to find and fix this difference.
Highlighted
Occasional Contributor

RE: Field Dichotomy: Found by One Script; Unusable by Other Script

So, tell me if this makes sense: I recorded a script, Test3, that is identical in every way to Test2.  When I first ran Test2, it worked; then, it stopped working.  When I first recorded Test3 and ran Test3, it worked; after I ran Test2, not only did Test3 fail, but Test2 started failing, too.  Again, there is no difference at all between the two scripts.
Highlighted
Staff

RE: Field Dichotomy: Found by One Script; Unusable by Other Script

You can try to update NameMapping as it described here: http://support.smartbear.com/viewarticle/55793/.

Also maybe after the first run of your script something changes in your application so the object cannot be found anymore, so maybe you need to restore the initial state of your application before running the test.
Highlighted
Occasional Contributor

RE: Field Dichotomy: Found by One Script; Unusable by Other Script

I restart the Application for each test, so I don't think that Application state comes into play...  I'll look at updating name mapping, but this remains confounding.
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors