QTP Q/A's........................................................
Browser("Calendar").Page("Calendar").WebList("Hour").Select "#3"
Note - Indexing starts from 0 so the above line will fetch the 4th value from the drop down list. But if the
values in the drop down change then irrespective of the value you want, it will always give you the value
in the 4th position of the drop down.
1. Grab all the items in the list by using the value property.
2. Split the values if they are semicolon separated.
3. Compare the value which you need to select vs the value in the split array.
4. Then select based on the index.
How to select item from weblist?
Browser("Calendar").Page("Calendar").WebList("Hour").Select "#3"
Note - Indexing starts from 0 so the above line will fetch the 4th value from the drop down list. But if the
values in the drop down change then irrespective of the value you want, it will always give you the value
in the 4th position of the drop down.
1. Grab all the items in the list by using the value property.
2. Split the values if they are semicolon separated.
3. Compare the value which you need to select vs the value in the split array.
4. Then select based on the index.
How to check a value exists in a weblist using QTP ??
noItems=browser("name:=Web*.*").page("title:=Web*.*").weblist("name:=depart").GetROProperty("items count")
flag=false
For i=1 to noItems
If lcase(browser("name:=Web*.*").page("title:=Web*.*").weblist("name:=depart").GetItem(i))="uday" then
flag=true
end if
Next
If flag=true Then
msgbox "Exists"
else
msgbox "Not Exists"
End If
flag=false
For i=1 to noItems
If lcase(browser("name:=Web*.*").page("title:=Web*.*").weblist("name:=depart").GetItem(i))="uday" then
flag=true
end if
Next
If flag=true Then
msgbox "Exists"
else
msgbox "Not Exists"
End If
No comments:
Post a Comment