Forum Discussion

kford's avatar
kford
Occasional Contributor
10 years ago

Using Parameters and Variables Help

My company is a .net shop and our data is very Dynamic.  Each time we access a form on a web page, that page creates what we call a “Recid”. When I record an automated test and then re-run that test, I get an error saying “object was not found”. I am guessing this is because the page now has a Recid different than the one when I first recorded the test. How can I get around this? I need the automated test to except whatever the newest Recid will be.

 

Example.

 

When I recorded an automated test, the Recid=15266 (see below). The next time I access the same web-page, this Recid will equal 15227 (or even higher number)

 

https:/ser/Crf/Enter.aspx?Id=R01-0028BB&RecId=15226

 

I have looked at the Smartbear creating parameters and using variables videos but do not see anything that addresses this particular issue

 

I am testing out TestComplete 10.30 to see if this is a product my company may want to purchase. However, the above issue would be a show stopper for us.

 

Thanks for any help you can provide

6 Replies

  • It sounds like you just need a wildcard in place of your recid. Replace your recid with an asterisk in your mapping and it'll accept whatever id is present.
  • I tried that and it works. But I am having to go object by object in Smartbear to add the wildcard ‘*’. Is there a way to change or define at a global level? It would be impossible for me to manually change so many one by one each time a recorded a test case and tried to playback successfully. We have many objects with in one form

  • Assuming you're using a name mapping file, you should only need to wildcard the page object, not it's children. If you're doing it for several different tests, I'd recommend using a "master" name mapping file so you only need to get things right once, then you right-click on your project and add the existing name mapping file.
  • How do I do this? see attachments. Each click is an object with the recid in it. I am having to right click on each object and selec "Show Object in Name Mapping Editor" and then replace to recid with the wildcard "*".





  • I see, so it's not just that the page you're on has a recid, but each link has one as well. 



    Honestly, I'd probably use another property to map the links other than ObjectIdentifier. I'd use contenttext or something since I'd always be concerned that something in that long ObjectIdentifier might change with a new build/code changes. Unfortunately, that would still require editing every mapped object, just as you would have to do to wildcard out the recid.



    Unfortunately, I'm not sure there's a better answer. When I'm interacting with a new page, I'll usually map everything up front with the properties I want to use, then create the test. But I script my tests, rather than use keyword tests.



    Sorry I don't have any better ideas for you.
  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)
    Hi Bruce,

     


    You can create a Name Mapping template for this kind of objects and specify the mapping criteria and their values that will be used by TestComplete. After that, you'll need to record a test anew, and it will be recorded with the new aliases. There is no need to modify each object. Please read the "Edit Name Mapping Template Dialog" article for details.