Highlighted
Absent Member.. Absent Member..
Absent Member..
451 views

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?

0 Likes
1 Reply
Highlighted
Trusted Contributor.
Trusted Contributor.

Re: Exist statement not working

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)

0 Likes
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.