Micro Focus QTP (UFT) Forums
How to select dynamic checkbox from web dropdown - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: How to select dynamic checkbox from web dropdown (/Thread-How-to-select-dynamic-checkbox-from-web-dropdown)



How to select dynamic checkbox from web dropdown - QA_Newbie - 06-27-2014

Hi All,

I am trying to write the script in QTP which will randomly pick the checkboxes in the dropdown everytime the script is run.
Each checkbox has a unique number followed by the label. I would like to print all the labels whose check boxes were chosen.
The check box numbers are not in sequence.

Thanks a lot for your help.


RE: How to select dynamic checkbox from web dropdown - supputuri - 07-03-2014

There will be pattern associate with the labels, find the pattern. Get the list items count and generate the random numbers based on your requirements to append with the label. Now you have the dynamic list item property ready for use - hope you can take it forward from here.


RE: How to select dynamic checkbox from web dropdown - QA_Newbie - 07-20-2014

Here is what i did.
Code:
Function xx()
Dim yy
yy=Array("1","2","3"...., "19")
Randomize
SelectedProperty=yy(Int(Rnd*19))
Print("selected:"&SelectedProperty)
xx=SelectedProperty
End Function

I call this function in my script. Everytime the script is run it chooses the random property from the list.