Highlighted
Absent Member.. Absent Member..
Absent Member..
538 views

Trouble grabbing a popup message content using DP

Jump to solution

Hello,

I'm trying to use DP to get the value of a simple popup message by creating a function that will live in a shared function library.  Here is the code:

If Dialog("text:="&NxPracticecaption).Exist(5) Then
    MsgBox ("dialog found")
'    If Static("nativeclass:=Static", "text:="&ExpectedMessage).Exists(0) Then
    If Static("nativeclass:=Static""text:="&ExpectedMessage).Exists(0) Then
        MsgBox ("Message found")
        VerifyPopups = 0
        Exit Function
        End If
    End If
MsgBox ("Message NOT found!!!")    
VerifyPopups = -1

 

2 things I'm struggling with:

  1. The Static("nativeclass...... code is incorrect, and throwing an error: File: C:\code\trunk\QA\UFT\Shared\FunctionLibraries\PracticeFunctionLibrary.qfl line (74): " If Static("nativeclass:=Static", "text:="&ExpectedMessage).Exists(0) Then". Description: Syntax error.  Having a heck of a time debugging.
  2. What are the items like Static, Dialog, Window, etc. that preceed the descriptions referred to as? I did some research, and it seems that they are defined in the registry with items that are used to for recognition properties, but that just a shot in the dark guess from a relatively novice qtp/uft user (me).  

I'm hoping this is a little bit more than just being fairly ignorant on object programming and uft in particular and the solution can help others with similar levels of experience.

Thanks,

Bret

0 Likes
1 Solution

Accepted Solutions
Highlighted
Absent Member.
Absent Member.

Could you spy the static object and observe the hierarchy ?

If you need to highlight a static text, you would need to include its parent object - could be a dialog or window which you can find in the heirarchy 


Accept as solution/Give Kudos to the author if the piece of information answered/helped you to solve your problem.
All the thoughts here are mine not related to my employer nor anyone.

View solution in original post

3 Replies
Highlighted
Absent Member.
Absent Member.

Can you try specifying the heirarchy which you can find in object spy -

For ex: Dialog("text:="&NxPracticecaption).Static("nativeclass:=Static", "text:="&ExpectedMessage).Exists(0)


Accept as solution/Give Kudos to the author if the piece of information answered/helped you to solve your problem.
All the thoughts here are mine not related to my employer nor anyone.
Highlighted
Absent Member.. Absent Member..
Absent Member..

Thanks, but that didn't work.  The error message that I get is:


Object doesn't support this property or method: 'Dialog(...).Static(...).Exists'

 

 

0 Likes
Highlighted
Absent Member.
Absent Member.

Could you spy the static object and observe the hierarchy ?

If you need to highlight a static text, you would need to include its parent object - could be a dialog or window which you can find in the heirarchy 


Accept as solution/Give Kudos to the author if the piece of information answered/helped you to solve your problem.
All the thoughts here are mine not related to my employer nor anyone.

View solution in original post

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.