For ordinal identifiers, the help document of qtp is as follows:
An ordinal identifier assigns a numerical value to a test object that indicates its order or location relative to other objects with an otherwise identical description (objects that have the same values for all properties ). this ordered value provides a backup mechanism that enables quicktest to create a unique description to recognize an object when the defined properties are not sufficient to do so.
There are a total of three such sequence identifiers: location, index and creationtime
The creationtime is only applicable to browser objects.
Ordinal identifiers are usually used in descriptive programming.
Example 1: Location)
'Text box 1
Browser ("title: =. * descriptive. *"). page ("micclass: = page "). webedit ("Name: = dptest", "Location: = 0 "). set "1"
'Text Box 3
Browser ("title: =. * descriptive. *"). page ("micclass: = page "). webedit ("Name: = dptest", "Location: = 1 "). set "2"
'Text Box 2
Browser ("title: =. * descriptive. *"). page ("micclass: = page "). webedit ("Name: = dptest", "Location: = 2 "). set "3"
'Text Box 4
Browser ("title: =. * descriptive. *"). page ("micclass: = page "). webedit ("Name: = dptest", "Location: = 3 "). set "4"
Example 2: Index (the index sequence is from left to right)
'Text box 1
Browser ("title: =. * descriptive. *"). page ("micclass: = page "). webedit ("Name: = dptest", "index: = 0 "). set "1"
'Text Box 2
Browser ("title: =. * descriptive. *"). page ("micclass: = page "). webedit ("Name: = dptest", "index: = 1 "). set "2"
'Text Box 3
Browser ("title: =. * descriptive. *"). page ("micclass: = page "). webedit ("Name: = dptest", "index: = 2 "). set "3"
'Text Box 4
Browser ("title: =. * descriptive. *"). page ("micclass: = page "). webedit ("Name: = dptest", "index: = 3 "). set "4"
Example 3: creationtime (effective only for browser objects, arranged in order of the object generation time)
Systemutil. Run "iexplore.exe", "http://www.HP.com" 'creationtime 0
Systemutil. Run "iexplore.exe", "http://www.AdvancedQTP.com" 'creationtime 1
Systemutil. Run "iexplore.exe", "http://www.LinkedIn.com" 'creationtime 2
Browser ("creationtime: ="). Highlight 'highlight hp.com
Browser ("creationtime: = 1"). Highlight 'highlight advancedqtp.com
Browser ("creationtime: = 2"). Highlight 'highlight appsin.com
Refer:
Http://relevantcodes.com/descriptive-programming-dp-concepts-3-ordinal-identifiers-demo/