Forum Discussion

anselm_nog's avatar
anselm_nog
Occasional Visitor
11 years ago

Creating a loop to login into a application multiple times

Hi,

 

Im new to test complete and im trying to create an automated test that logins into the application multiple times, approximately 50 to 70 times.

 

I have recorded using the Keyword test, that takes the username password and clicks on the login button. This is successful and the Items are displayed in the test pane. Now I want to add the For loop and a variable to loop the login for 50 times. 

I add the For Loop from the Statements and the end of all the other items and give the following values -

Loop variable = n/a

Start value = 0

End Value = 50

Step =1

 

But this does not loop. It only runs for one iteration.

 

What am I doing wrong over here?

 

Kindly help

 

Anselm.

  • Hi,

     

    Make sure that the operators that are supposed to be inside your loop are located on the next level in the hierarchy of operators. Here is an example:

     Capture.PNG

  • gvkr1985's avatar
    gvkr1985
    Occasional Contributor

     

    Flag =0 

    DO While(Flag < 60)

     

    Call  Browsers.Item(BrowserName).Run(URL)

    Capture the name text box in Login window and enter the value

    Capture the password textbox and enter the value

    capture the login button and click

    Flag = Flag+1

    Loop

     

    Above script works 60 times with the same set of values... if you want 60 set of values, you can use DDT(Excel sheet)