cancel
Showing results for 
Search instead for 
Did you mean: 

How to store a value that is generated in a transaction in test complete

Frequent Contributor

How to store a value that is generated in a transaction in test complete

My keyword test case is creating a work order ID in its run after doing 'n' number of steps.

I need test complete to remember or store the value from taht step and use it in next step.

How do I do this? If there is a Video please send a link.

 

28 REPLIES 28
Community Hero

Re: How to store a value that is generated in a transaction in test complete

Variables.   IF the two steps are in the same Keyword test, then it's simply a variable in that keyword test.  If you need to store a value generated in one test to be used in another, Project level variables will work well for that.  If you use script code, you can create units that contain variables that you can then import into other units... you could even go so far as to create a Runtime Object script extension whose purpose it is to have globally available "properties" that you can assign values to use from one test step to another...

 

Plenty of possibilities... no "one right way"... it depends a little bit on what you're comfortable doing.


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
Frequent Contributor

Re: How to store a value that is generated in a transaction in test complete

Variables.   IF the two steps are in the same Keyword test,

Yes my work order ID is being used in same keyword test. 

I created a variable and it is a string variable with no value in it.

But when the test is running it is not saving the value in that variable?

 

 

Community Hero

Re: How to store a value that is generated in a transaction in test complete

How are you assigning the value to the variable?  ARe you using the "Set Variable" operation?  What does that look like in your test?  I see the variable definition so that's fine, but you need to specifically call "Set Variable" to assign the value.


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
Frequent Contributor

Re: How to store a value that is generated in a transaction in test complete

Yes I am using Set Variable Value

Frequent Contributor

Re: How to store a value that is generated in a transaction in test complete

But it si a gLobal Variable at Project level and not at the test level.

Highlighted
Frequent Contributor

Re: How to store a value that is generated in a transaction in test complete

But it is a global Variable at Project level and not at the test level.

Community Hero

Re: How to store a value that is generated in a transaction in test complete

OK... I see the call... but I don't see what's being assigned... I see an Alias of some sort but are you referencing the object?  Or a property of an object?  Please open up the dialogs and give us print screen so we can see what you're assigning.


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
Frequent Contributor

Re: How to store a value that is generated in a transaction in test complete

Screenshot of the Set variable value screen

Community Hero

Re: How to store a value that is generated in a transaction in test complete

That just shows what variable you are selecting... the next screen from there should show what you're setting the value of the variable TO.... that's the important part that's missing... because if you have a string variable that oyu're trying to assign an object to, that won't work.  


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
New Here?
Join us and watch the welcome video:
Top Kudoed Authors