Exist statement not working

Hello,

we have a problem with the Exist sentence.

We have this code:

variable=false
variable=Device("Device").App("App").MobileLabel("Label").Exist(3)

If variable Then
'Something
End If

When the label exists, the TRUE value is assigned to "variable" without any problem.
When the label does not exist, a error pop up (General Run) appears and no value is assigned to "variable". The correct behavior (which we have found all time) is assign a FALSE value to "variable", but now, we don't know why, it is not working.

We have latest version of HP UFT integrated with latest versoin of HP Mobile Center.

Anybody else has had this problem? Any clue?

Parents
  • if Device("Device").App("App").MobileLabel("Label").Exist(3) Then

    Something

    Else

    Something

    End if

    Why not like this??? why additional variables?

    When the label does not exists? Does it means it becomes hidden? if yes you should be checking for visible property and not exist.

     

    [If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]

    (Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.No warranties express or implied for any solution/suggestion posted)

Reply
  • if Device("Device").App("App").MobileLabel("Label").Exist(3) Then

    Something

    Else

    Something

    End if

    Why not like this??? why additional variables?

    When the label does not exists? Does it means it becomes hidden? if yes you should be checking for visible property and not exist.

     

    [If this post solves or helps solve your issue, mark the thread as solved and give KUDOS to the author for their assistance.]

    (Opinions expressed in my postings are mine alone, and do not reflect the opinions of my employer.No warranties express or implied for any solution/suggestion posted)

Children
No Data