Very new to QTP, but a seasoned user of Load Runner. I have been able to delete the first flight out of the itenerary in the Mercury Flights training program, but I cannot figure out how to randomly delete a flight if there are multiples.
I'm guessing the only way is to store the number of checkboxes in a variable and then srand() to get a random checkbox?
Here is what I have so far, it is not working and I am pretty lost on where to go from here. :-/
I know I need to add a while loop to go through all of the checkboxes, but I am unsure of how to make it advance to the next checkbox...
<font class="small">Code:</font><hr /><pre>Function FindCheckbox
checkboxtype = Browser("Welcome: Mercury Tours").Page("Itenerary: Mercury Tours").WebCheckBox.GetROProperty("type")
If checkboxtype = "checkbox"Then
checkboxcount = checkboxcount +1
msgbox "The number of items is "&checkboxcount,vbokonly
End Function </pre><hr />
' This function finds the total number of checkboxes on the itenerary and selects one at random
Function FindCheckbox ()
a("html tag <http://localhost/servlets/com.mercurytours.servlet.IteneraryServlet>").va lue="input"
Set b=Browser("name:=Itenerary: Mercury Tours").Page("Title:=Itenerary: Mercury Tours").childobjects(a)
RandomCheckbox = RandomNumber(0,c-1)
Msgbox "The random Number is" &RandomCheckbox