QTP Code – randomly select the drop-down box option

Posted on Dec 20 2012 - 8:06am by Raj

1, randomly select the drop-down options:
‘Get the number of drop-down options
t = Browser (“Browser”) Page (“User Management”). WebList the (landing type). GetROProperty (“items count”)
‘Random selection drop-down option
Browser (“Browser”) Page (“User Management”). WebList the (landing type). Select RandomNumber (0, t-1)

2, print, select the drop-down option values
‘Get the selected drop-down option values
m = Browser (“Browser”) Page (“User Management”). WebList the (landing type). GetROProperty (“selection”)
‘Print drop-down option values
MsgBox m

About the Author

Leave A Response