Ordinal identifiers)

Source: Internet
Author: User

 

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/

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.