Pavani:
I have something similar in that I have a webEdit which appears to be
a weblist (dropdown list). The webEdit has a down arrow associated
with it. (Actually I had four of these webedit fields on one web
page.)
What I had to do was the following. The "select_field" is the down
arrow that occurs along side the webEdit field.
Function someName
Set obj = Browser(bro).Page(pg).webElement("Select_field").Object
Set dr = CreateObject("Mercury.DeviceReplay")
Set wshShell = CreateObject("WScript.Shell")
' first activate the drop down list and then put the cursor into
the edit field
obj.focus
obj.click
' Put the cursor in the webedit field
' you will have find your own coordinates
dr.MouseClick 316,320,LEFT_MOUSE_BUTTON
wait(2)
wshShell.SendKeys"{DOWN}"
Call FindItemInList ("webEdit_name","name want to select")
' the sub should have selected the value wanted in the
list
' so I am just going to verify
var =
Browser(bro").Page(pd).WebEdit("webEdit_name").GetROProperty("value")
print "selected the value = " & var
Set obj = Nothing
Set wshShell = Nothing
Set dr = Nothing
wait(1)
End Function
sub FindItemInList (listName,tofind)
Dim wshShell, flag, var, s, i
Set wshShell = CreateObject("WScript.Shell")
flag = ""
' s = ""
Do until flag = "stop"
wshShell.SendKeys"{DOWN}"
var =
Browser(bro).Page(pg).WebEdit(listName).GetROProperty("value")
' s = s & vbcrlf & var
i = i + 1
If i = 30 Then ' some number to make
certain an infinite loop cannot happen
flag = "stop"
End If
' ' you might want to change the following to InStr rather than equals
If Trim(var) =Trim(tofind) Then
flag = "stop"
wshShell.SendKeys "{ENTER}"
End If
Loop
' msgbox s
Set wshShell = Nothing
End Sub ' FindItemInList
hth,
Parke
On Fri, Jun 28, 2013 at 12:28 AM, pavani b <[email protected]> wrote:
>
>
> Jun 22
> hai all
>
> Please anyone can write function for the follwing query(urgent)
>
> PFA....screenshot
>
> In the application i have an EDIT BOX ,where i have to enter SKU as
> the user types PREDICTIVE LIST will come under the EDIT BOX.
> I need to click on the item from the list based on the value entered
> in edit box(ex:like google search)
> whole list is identified as webelement. Each item in the list is
> identified as webelement
>
> i am using send keys to pass the SKU webedit
>
>
>
> Thanks in Advance
> Pavani
>
> --
> --
> You received this message because you are subscribed to the Google
> "QTP - HP Quick Test Professional - Automated Software Testing"
> group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/MercuryQTP?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "QTP - HP Quick Test Professional - Automated Software Testing" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
Parke
Cell: 770-842-0121
--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
---
You received this message because you are subscribed to the Google Groups "QTP
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.