Big news! The community will be moving to a new platform April 21. Read more.
Big news! The community will be moving to a new platform April 21. Read more.
Absent Member.. Absent Member..
Absent Member..

Exist statement not working


we have a problem with the Exist sentence.

We have this code:


If variable Then
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?

1 Reply

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




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)

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.