Zeenyx Academy

Incremeting Entitities for Uniqueness

Print Friendly, PDF & Email

Many applications contain entities that must be unique. A common example is a customer or member identifier like email address. To prevent input errors, automated tests must be designed to ensure that these identifiers are unique. There are several techniques to achieve uniqueness, including appending date/time strings or a unique number to the entity name. This post describes the latter solution.

The image above displays source code for the Incrementer function. It takes as parameters the name, section and lValue of the .ini file that will be used to store the current value of the incrementer. It also takes a Boolean flag that specifies whether to increment the value on the current call. This is useful because some calls might want to get the current value of the incrementer without changing its value. The function outputs the current value of the incrementer as an out parameter of type integer. It also returns it as a string for convenience.

The function is quite simple. It opens the specified .ini file, gets the value of the incremeter specified by the IncrementerLValue parameter and converts it to an integer. If bIncrement is set to ‘true’, it increments the rValue and writes it back to the .ini file. Finally it sets the IncrementerValue and passes it to the calling function through both the out parameter and the return value.

The calling function can then append the retuned value to an entity name before inputting it to the target application.

If you have any questions about this approach or would like to obtain a copy of the function’s source code, please contact Zeenyx Support.

Share the Post:

Related Content

Instructional Content, Thought Leadership

A Thousand G2 Reviews Later: Software Testing Tools Are Too Expensive

Instructional Content, Thought Leadership

Build Tests, Not Frameworks

Instructional Content

AscentialTest Error Tracking and Debugging

Instructional Content

Self-Guided PowerBuilder Tutorial

Get Started For Free: 30 Day Trial

Click here to download the Host ID generator. The download package includes full instructions. Please send us your details below to speed the process along.

Our Distribution and Consulting Partners

Appeon

Cigniti

Loop Software

Marlabs

Matryxsoft Tech

Novalys

OCS Consulting

Loading...

What We Are Up To Next

TFS/Azure Integration

Check our new Azure extension for executing AscentialTest command lines in the Azure Marketplace.

We look forward to offering additional integration with Microsoft’s Team Foundation Server and Azure through defect tracking and version control soon.

Omnis Studio

Automated testing support for OMNIS Studio is coming soon. All OMNIS elements will be supported including complex grids, list boxes, tables and tree views.

Custom Objects

Add automated testing support easily for your custom application elements by responding to simple test API messages with json strings. This feature will open up the possibility of testing any GUI element and  will be offered free of charge.

Test Debugger

Set breakpoints in your automated tests, view global and local variables and execute statements to make it easier to debug tests running on any of our supported platforms.

Get a Competitive Quote

Thank you for submitting your inquiry!

We will get back to you ASAP.  We aim to respond to all inquiries within 24 hours.