Forum Discussion

tmi5019's avatar
New Contributor
11 years ago

Increment number in text box using a for loop

Hello, I have a test that loops using a for loop multiple times creating multiple individual entities. Each entity is given a name using a textbox. Is there a way to get TestComplete 9 to incre...
  • Marsha_R's avatar
    11 years ago
    I don't know an automatic way to do it but here's how I set it up in one keyword test:

    Use this for the name of the entity in a set_text or wherever you need it

    "Entity # " + aqConvert.IntToStr(Project.Variables.Entity_Counter)

    Entity_Counter is an integer variable (project or local, whatever you need)  that gets incremented in your loop 

    Your entity names will look like this

    Entity # 1

    Entity # 2

    Entity # 3