Forum Discussion

cmbdnne's avatar
cmbdnne
Occasional Contributor
6 years ago

Capturing, using and updating a test value changing from test to test

 

 

Hi, I have a question as to how to capture and use a test value that changes every time the test is re-run.

 

In short, in my test I create an asset which automatically is assigned an ID value created by my app, not manually by me.

It is this value that I need to somehow capture and use in the rest of my test.

 

But when I re-run my recorded test, this ID value automatically changes from e.g. FA0101 to FA0102, and I need TestComplete to come up with a solution in which this new value replaces the old value in all the relevant spaces and steps in the test.

 

I can send screenshots or elaborate further if something is unclear.

 

Thank you in advance!

15 Replies

  • baxatob's avatar
    baxatob
    Community Hero

    Hi,

     

    As one of the possible solution you can store ID in a variable and use this value during your test.

    • cmbdnne's avatar
      cmbdnne
      Occasional Contributor

      Hi, thanks for your answer.

      I've tried to assign the asset ID to a variable value, both by trying to capturing it as an object property and an onscreen object. Problem here is that TestComplete doesn't appear to "grasp"/recognise this as a value and thus nothing appears when I'm trying to print this value out to a log.

       

      Also - I need to use this value throughout the test but when the test is re-run, a new ID value is going to appear and this value should replace the previous value used (hope this makes sense) - and is that possible if a such variable value is defined as an object property/onscreen object?

      • baxatob's avatar
        baxatob
        Community Hero

        Can you provide an Object Browser data for the mentioned element (the textbox with ID)?