Posts: 16
Threads: 11
Joined: Apr 2011
Reputation:
0
09-07-2016, 12:18 PM
hi,
I need help. I had figured out a way to select links using descriptive programming and am now not able to select an item within a WebMenu.
I cannot loop through theitems within that WebMenu .
Properties of the WEbMenu include:
top level items: Email;SMS;Telephone (Land Line);Postal;Cell Phone
outetext: EmailSMSTelephone (Land Line)PostalCell Phone
How can I loop through and select oneof these options?
Posts: 516
Threads: 17
Joined: Jul 2009
Reputation:
3
09-28-2016, 09:12 PM
Can you please share the screenshot of the SPY and it would be great if you can share the page link (provided it a generic website but not the client website page).
Thanks,
SUpputuri
Posts: 57
Threads: 13
Joined: Feb 2014
Reputation:
0
10-04-2016, 09:21 PM
(This post was last modified: 10-04-2016, 09:22 PM by venkatesh9032.)
Hi,
If you spy on the webmenu u will get all items options so use below syntax.
starValues = B().Pg().webmenu().getropropert("all items")
''Webmenu items will be segregated by space or semi coloumn mostly. In that case split the according to delimeter shown in object spy
strValArray = Split(starValues ,; )
Msgbox Ubound(strValArray)
''Use for loop to get values and add conditional stmt to select values
For i= 0 to ubound(strValArray )
Print Trim(strValArray (i))
Next
'''Please tell me if i answered ur question
Posts: 16
Threads: 11
Joined: Apr 2011
Reputation:
0
10-05-2016, 06:37 PM
This is what my code looks like:
Elements = Browser().Page().WebElement().GetROProperty("all items")
iTemCount = Elements.Count
For intCounter = 0 to iTemCount - 1
WebValue = Elements(intCounter).GetROProperty("innertext")
If Instr (1, LCase(WebValue), LCase(CrReg)) Then
MsgBox CrReg
Setting.WebPackage("ReplayType") = 2
Elements(intCounter).Click --------------This is where my code fails. i.e I cannot click on the desired value
Setting.WebPackage("ReplayType") = 1
Exit For
End If
Next