Possible to view/confirm a HUD (Heads Up Display)

66 views
Skip to first unread message

John Bateman

unread,
May 17, 2013, 5:28:40 PM5/17/13
to calaba...@googlegroups.com
Is there a way to get calabash to interact with a "Heads Up Display"? My application has HUDs that are displayed for about 5-10 seconds before they fade away. They give messages like "Contacting drivers..."

I have tried to interact with these via script and console, with no luck.
For example, a HUD is visible in the iOS 5.2 simulator with the text "Contacting drivers..."
at the console:
query "view marked:'Contacting drivers..."   returns false
element_exists("view marked:'Contacting drivers...'")   returns false
element_exists("view marked:'Contacting drivers\.\.\.'")  (adding backslash to escape periods) returns false

but
query "view", :text
returns one view with the text "Contacting drivers"

What do I have to do to verify the existence of this element?

Thanks.

Krukow

unread,
May 18, 2013, 6:55:51 AM5/18/13
to calaba...@googlegroups.com
It looks like the HUD isn't very accessible - try running

label "*"

when the view is visible.

Then you should try

element_exists("view text:'Contacting drivers...'")

wait_for_elements_exist([ "view text:'Contacting drivers...'"])

John Bateman

unread,
May 18, 2013, 6:19:49 PM5/18/13
to calaba...@googlegroups.com
I got the same false negative when using "text:" in place of "marked:" when the HUD was visible. I expected these things to be challenging.


--
You received this message because you are subscribed to the Google Groups "calabash-ios" group.
To unsubscribe from this group and stop receiving emails from it, send an email to calabash-ios...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Sincerely,

John Bateman
415.652.8322

Krukow

unread,
May 20, 2013, 1:39:35 PM5/20/13
to calaba...@googlegroups.com
If you can do 

query "view", :text 

that that gives a result

you can try element_exists("view text:'xx'") at the same time and that should be true

Otherwise something else is up here (like a timing sensitivity)

Jani Jegoroff

unread,
May 21, 2013, 9:23:54 AM5/21/13
to calaba...@googlegroups.com
My application uses MBProgressHUD for the same purpose and I use just a simple query to detect when HUD is visible.

irb(main):005:0> query("view:'MBProgressHUD'").empty?
true
irb(main):006:0> query("view:'MBProgressHUD'").empty?
false

Reply all
Reply to author
Forward
0 new messages