Below example illustrates how We can get the all items from the drop down in QTP.
arrWeblistItems = split(objParent.weblist("name:=listType").GetROProperty("all items"),";")
'print total number of items in the listbox
print arrWeblistItems.count
For itemCounter =0 to ubound(arrWeblistItems)
'print the value in the dropdown
print arrWeblistItems(itemCounter )
Next
This is how we can print the all items in the list box in QTP.
We can also get all items in the combo box using HTML DOM + QTP as shown in below code.
Set col = ObjParent.weblist("name:=tranType").object.getElementsByTagName("option")
For i=0 to col.length-1
'print the value in each option inside combobox
print col(i).innerText
Next
Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com
arrWeblistItems = split(objParent.weblist("name:=listType").GetROProperty("all items"),";")
'print total number of items in the listbox
print arrWeblistItems.count
For itemCounter =0 to ubound(arrWeblistItems)
'print the value in the dropdown
print arrWeblistItems(itemCounter )
Next
This is how we can print the all items in the list box in QTP.
We can also get all items in the combo box using HTML DOM + QTP as shown in below code.
Set col = ObjParent.weblist("name:=tranType").object.getElementsByTagName("option")
For i=0 to col.length-1
'print the value in each option inside combobox
print col(i).innerText
Next
Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts. You can write to me at reply2sagar@gmail.com
No comments:
Post a Comment
Please Leave your reply. We value your feedback and inputs