| || |
do while / while wend / ExitDo
Does anyone have experience with ExitDo?
When I enter it into UFT 12.01 it is not turning into a bold font.
Can it be used?
What is the best combination of
Looping start and end pairs?
Do they all work?
I usually stick to For Next so I'm rusty on Loops without bounds.
The issue you're having is that it should be separated, "Exit Do." All the vbscript Exits are separate keywords. HP, in their infinite wisdom, made all their exits into single keywords. Bless their hearts.
As far as I know, all the different Do loop structures work. The best combination changes with the situation. I've used them all at one point or another.
Exit Do can be used. (Might be showing up as plain text for you because there is supposed to be a space between "Exit" and "Do")
Originally Posted by bklabel1
Here is an example of "Exit Do" that I have been using reliably in UFT 12.01
counter13740 = 0
Do until counter13740 = 4
If Browser(uSiteTitle).Page(uSiteTitle).WebButton("ht ml id:=gradebookSubmit").GetROProperty("disabled") = 1 Then
counter13740 = counter13740 + 1
If counter13740 = 3 Then ' If 3 loops complete without autosave firing then try clicking on the save button
Browser(uSiteTitle).Page(uSiteTitle).WebButton("ht ml id:=gradebookSubmit").Click
Dennis and TacEx,
I'm reading it as though you are saying the opposite about the space on Exit YYYYYY. I observed that different Exits require or do not use it.
I'll have to test it every place I use it.
I have not tried ExitAction or ExitActioniteration inside of a library. It has never worked for me in earlier versions.
Any VBScript keywords that use Exit should have a space. Any QTP/UFT keywords that use Exit should not. For example, Exit Do is a vbscript thing and has a space. ExitTest is a QTP thing and doesn't have a space. This is because the QTP/UFT keywords are really just vbscript functions, which cannot have a space in the name.