Forum Discussion
Hi,
As one of the possible solution you can store ID in a variable and use this value during your test.
- cmbdnne6 years agoOccasional 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?
- baxatob6 years agoCommunity Hero
Can you provide an Object Browser data for the mentioned element (the textbox with ID)?
- cmbdnne6 years agoOccasional Contributor
Hi again,
I'm not sure if this was what you're asking for but as the test steps illustrate, I establish a new project with the name testcontrol0402. As this name cannot be the same when I re-run the test, I've replaced the project name with a code expression which names the new project after the date and time of its creation.
This date and time expression value is what I would like to capture in a variable to use further on in the test.
When I re-run my test, the new project will have a different date/time value which then should captured and use further on in the test.
I hope this makes sense & thank you for your help.
- Marsha_R6 years agoChampion Level 3
It sounds like you're storing an object in the variable because those can't be printed out. Look in the Object Browser like baxatob said or use the Object Spy on the Asset ID and find a field that has a text version of the ID. That's what should go in the variable.
- tristaanogre6 years agoEsteemed Contributor
OK... so... based upon those screenshots... what you have in screenshot 5 ALLLLLL the way to being like the first step of your whole test case. It doesn't have to be EXACTLY the first step, but it should be defined before what you have in screenshot 1.
Then, in screenshot 1, double click on that line you have highlighted where it says "testcontrol1002". You want to get to where you can declare that parameter. When you get to that point, change the "Mode" drop down to Variable and then, in the "Value" field, find and select the variable you declared.
Then, do the same thing for the operation you have in Screenshot 2...
That should basically do what I described.
Related Content
- 11 months agoakilan
- 12 months agoMW_Didata
- 12 years agoachand
- 12 years agopratyushdash
Recent Discussions
- 5 hours agodhundley