WebList as WebElement

2,269 views
Skip to first unread message

Deepak Kumar Mahapatro

unread,
Mar 16, 2012, 8:45:24 AM3/16/12
to Mercu...@googlegroups.com
Hi All,
In my application, a weblist is identified as webelement and all the list items also. i use webelement("").click two times for the list once and for the list item once. For the list it works fine but it can't identify the object for list item. i tried DP also.the object can be identified by object spy . Can anyone suggest any solution

Thanks In Advance

Regards,
Deepak

Kishor Kumar

unread,
Mar 16, 2012, 12:09:05 PM3/16/12
to mercu...@googlegroups.com
Hi Deepak,
if it is a AJAX and GWT Component then QTP Identifies as  Web Element.
you to try with WEB Extensibility kit. this one adds Ajax, DOJO and Yahoo UI plug in..

After installing , these plug-ins also, u r not able to identify, then we have to your own code, to deal with Custom Objects


--
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 Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

Deepak Kumar Mahapatro

unread,
Mar 16, 2012, 4:44:41 PM3/16/12
to mercu...@googlegroups.com
Hi,
I already tried with web exten. kit but still same problem and can you please elaborate about that custom object part?
--
Deepak Kumar Mahapatro

iRahulSingh

unread,
Jul 12, 2012, 8:19:52 AM7/12/12
to QTP - HP Quick Test Professional - Automated Software Testing
Hi Santosh / Deepak,

It seems like both of you are facing the same situation where WebList
is identified as WebElement and the basic reason for this is UI of
your respective application must be renewed and the developers must
have used jQuery to create the custom objects. Since QTP provide an
alternative for DOJO, AJAX, YUI etc objects in the form of Web 2.0 Dev
kit but they will be helpful in creating a custom object which somehow
behave as weblist ( in your case ) and will always be imported in your
each test as they act as an addin.

My suggestionto both of you is to work with DOM of your application
and try to identify the real object ( which will be present if you go
through the page source or use Firebug while using FF or inbuilt
inspect element feature of chrome ) ... by this way you will be able
to create DP objects for real objects which are present on webpage but
are not really visible to you on UI easily.

hope it help .... in case i'm not able to convey my point clearly ..do
let me know.


Cheers,

On Jul 12, 11:42 am, santhosh kumar <kskf...@gmail.com> wrote:
>    Hi depak/KK
>
>    I am also facing same issue as you mentioned ...
> In my application WebList is identified as Weblement .... I also tried what
> i had tried tried to accses list object and listitem object as WebElements
> but of no use.
> Please Let me know if you find any solution ... its Urgent for me ....

Parke Kuntz

unread,
Jul 12, 2012, 2:23:13 PM7/12/12
to mercu...@googlegroups.com
Hello depak:

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 corrdinates
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
If Trim(var) =Trim(tofind) Then
flag = "stop"
wshShell.SendKeys "{ENTER}"
End If

Loop
' msgbox s
Set wshShell = Nothing
End Sub

hth,

Parke

On 7/12/12, santhosh kumar <ksk...@gmail.com> wrote:
>
> Hi depak/KK
>
> I am also facing same issue as you mentioned ...
> In my application WebList is identified as Weblement .... I also tried what
>
> i had tried tried to accses list object and listitem object as WebElements
> but of no use.
> Please Let me know if you find any solution ... its Urgent for me ....
>
> On Friday, March 16, 2012 6:15:24 PM UTC+5:30, Deepak wrote:
>>
> --
> 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 Mercu...@googlegroups.com
> To unsubscribe from this group, send email to
> MercuryQTP+...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/MercuryQTP?hl=en
>


--
Parke
Cell: 770-842-0121

Shalabh Dixit

unread,
Jul 13, 2012, 12:59:29 AM7/13/12
to mercu...@googlegroups.com
I faced this thing in one of my application where the list is defined as webelement and all the list elements are defined as links. What I did was is just used regular expression \[a-z,|A-Z] since it was list of strings and disabled the smart identification and finally it worked for me.


Regards
Shalabh Dixit
My QTP Blog
Reply all
Reply to author
Forward
0 new messages