Highlighted
Contributor.
Contributor.
600 views

UFT 14.0: Timeout parameter value in Exist method of all the test objects available

I have observed a change in the behaviour of the Exist method of the test object(while working with Siebel objects) when different values( zero and positive) are provided as its parameter.

When 0 is passed as objTarget.Exists(0), the object existence returns false.

When 1 is passed as objTarget.Exists(1), the object existence returns true. 

Sample Code:

SiebApplication("SiebApp").SiebScreen("SiebScr").SiebView("SiebVw").SiebApplet("SiebApplet").SiebList("SiebList").SiebText("SiebText").Exists(0)

SiebApplication("SiebApp").SiebScreen("SiebScr").SiebView("SiebVw").SiebApplet("SiebApplet").SiebList("SiebList").SiebText("SiebText").Exists(1)

I have tried to find out any documentation regarding this behaviour. But the closest I found was a note "A value of 0 is not supported for Mobile test objects."

 

Does anybody has any idea regarding this behavior or can provide any reference?

0 Likes
3 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: UFT 14.0: Timeout parameter value in Exist method of all the test objects available

I'm wondering what you are expecting for the result of .exist(0).

As mentioned in help, UFT waits for the timeout or till it finds the object, whichever comes first.

By using 0, if seems that no time is given for UFT to find the object, hence returning false.

The note about mobile test objects is confusing though, it should not make sense to use 0 for any test object.

Hope it helps.

0 Likes
Highlighted
Contributor.
Contributor.

Re: UFT 14.0: Timeout parameter value in Exist method of all the test objects available

Hi StickyFingaz,

The synchronisation mechanism is already in place in my code, which for the sake of simplicity I haven't shown here.

And 0 is a valid value to be provided as a parameter in this .Exist method.

The expected behavior for the .exist(0) method is to return true/false as per the existence of the object without waiting for a second. This is a way that adds flexibility to my scripts and I have been using from long time.

My concern is the object is present on the UI but this method is returning false for it.

And, if I use the same method for an available web object it returns True as expected from this method.

 

The thing I want to know is there any known fact that 0 value doesn't work with .Exist() method of SiebList objects as it works with other objects.

I would like to suggest you to check this on your end that 0 value works with almost every kind of object as a parameter for the respective .Exist() method, in case you haven't tried it ever.(Just not for mobile as provided in the notes)

0 Likes
Highlighted
Contributor.
Contributor.

Re: UFT 14.0: Timeout parameter value in Exist method of all the test objects available

Kindly ignore the typo done. Please read the .exists method as .exist.

Thanks,

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.