Can you try this
strTool = Cstr(JavaWindow("XYZ").JavaButton("
BUTTON1").GetROProperty("toolkit class"))
strLabel =
CStr(JavaWindow("XYZ").JavaButton("BUTTON1").GetROProperty("label"))
msgbox JavaWindow("XYZ").JavaButton("toolkit
class:="&strTool,"label:="&strLabel).exist
2.
msgbox JavaWindow("name:=XYZ").Exist -- if it is false ..try index msgbox
JavaWindow("name:=XYZ","index:=0").exist if it is false try other property
if it is false msgbox JavaWindow("title:=abc","index:=0").
once above works with parent object.. try for child..
On Thursday, June 28, 2012 6:48:00 PM UTC-4, [email protected] wrote:
>
> Hi all,
>
> Has anyone encountered a situation where the OR recognizes an object but
> when they use descriptive programming it does not recognize the object?
>
> I am currently creating tests over a JAVA standalone application with all
> the correct plugins.
>
> For some reason for a certain object QTP recognizes it through the Object
> SPY and can be stored in the OR, but if I write a statement with the same
> object and descriptions, it does not recognize the object.
>
> Ex. BUTTON1 is defined in the OR and is recognized, both toolkit class and
> label are the only properties stored in OR, SMART ID is disabled.
>
> strTool = JavaWindow("XYZ").JavaButton("BUTTON1").GetROProperty("toolkit
> class")
> strLabel = JavaWindow("XYZ").JavaButton("BUTTON1").GetROProperty("label")
>
> msgbox JavaWindow("XYZ").JavaButton("toolkit
> class:="&strTool,"label:="&strLabel).exist
> msgbox JavaWindow("name:=XYZ").JavaButton("toolkit
> class:="&strTool,"label:="&strLabel).exist
>
> msgbox JavaWindow("XYZ").JavaButton("BUTTON1").exist
>
>
> In the above, the first and second msgbox returns a "false" and the third
> statement returns a "true"
>
> Has anyone ever encountered this and how to overcome? BTW using index is
> the same.
>
> Thanks.
> iaussi
>
--
--
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/d/optout.