When you have a statement that checks for the "visible" property using the .WaitProperty method, what does it mean when you get this "Warning" in the results file or results viewer?
The code is like:
object.WaitProperty "visible", "True", 60000
You run the script on one Android device and no Warnings, no Errors.
Run the same script on another Android device and still no Errors but with a "Warning" in the Result Details pointing to the Step Name with the .WaitProperty.
We have different flavors of the versions of the Android and iOS mobile devices that we are testing.
When I run my script on the newer and faster devices, I don't get this Warning in the Result Details.
I was thinking that maybe the wait for 60000 is not enough thus the Warning is triggered but, I could not find any documentation about it so I thought I should ask here and maybe someone had seen this before and knows what exactly the Warning is for.
I even made sure the Settings/Run dialog has the checkbox for "Disable Smart Identification during the run session" checked but, it didn't make a difference. I increase the wait from 60000 to 90000 and sometimes the Warning does not show up in the Result Details. So it looks like something with the timing or synchronization but I do have and use the .Sync for the MobiDevice (from Mobile Labs Trust Add-in) and it doesn't seem to help much.
Bottom line is that this Warning is coming up only for the devices that are slower or have older versions of Android.
It means that the property value did not match in the specified time.
WaitProperty doesn't fail, it only warns.
"Return Type: A Boolean value.
Returns TRUE if the property achieves the value, and FALSE if the timeout is reached before the property achieves the value. A FALSE return value does not indicate a failed step."
I have seen where the waitproperty does not wait for the full amount of time for the property to appear. My guess it that it works like this:
A) If the object cannot immediately be identified it gives a warning.
B) If the object can be immediately identified it waits for the property to match what it is waiting for.
I think it should work like this but sometimes I put a .Exists() on a line before the waitproperty.
I also capture the state of the property and it is in the state that the waitproperty should find right away.
The .Exists finds it right away.
The getroproperty returns the state that I am waiting for.
The waitproperty command does not wait at all. I get the warning message even though the object exists and is in the correct state.
Hey, I could be wrong but I thought that I have seen this happen more than once.
This is how I wait for webpages to complete processing, could you adapt this for your Android devise testing
MAX_PAGE_SYNC_WAIT_TIME = 120
iElapsedTime = 0
While .Object.readyState <> "complete" And iElapsedTime < MAX_PAGE_SYNC_WAIT_TIME
iElapsedTime = iElapsedTime + 1
If iElapsedTime > MAX_PAGE_SYNC_WAIT_TIME Then
' Do not found process
It happened to me on one application that readyState = "complete" that the application still did not have it's properties ready to be used. It gave me a starting point but then I had to add on a check of the first object on each page that I was going to use.