Can calabash-android handle alert dialog?

1,137 views
Skip to first unread message

Tam

unread,
Sep 21, 2012, 5:57:57 PM9/21/12
to calabash...@googlegroups.com
 If so, can you show me an example? 

Thanks

Jonas Maturana Larsen

unread,
Sep 23, 2012, 2:48:25 PM9/23/12
to calabash...@googlegroups.com
It can.

What do you want to do with the dialog?

- Jonas

David

unread,
Sep 24, 2012, 1:32:35 PM9/24/12
to calabash...@googlegroups.com
I don't think it can if its a system alert dialog. Such as... It can only handle alert dialogs created by your app. 

Tam

unread,
Sep 24, 2012, 3:30:45 PM9/24/12
to calabash...@googlegroups.com
When user input wrong login info, the alert dialog box pops up, 
I wanna be able to verify that :
 The alert dialog pops up, 
Verify the correct message display in the dialog box 
On click on the OK button in the alert dialog, the dialog goes away. 

Thanks!

Tammy

David

unread,
Sep 25, 2012, 1:45:55 PM9/25/12
to calabash...@googlegroups.com
You can just do 

Then I wait to see "correct message"
Then I press "OK"

Tam

unread,
Sep 25, 2012, 9:09:30 PM9/25/12
to calabash...@googlegroups.com
Thanks David. 
I tried it, it didn't work though. It just hang in there, waiting for the expected message to display. 

Tam

unread,
Sep 27, 2012, 9:22:56 PM9/27/12
to calabash...@googlegroups.com
Hi, Jonas, 

Can you provide a little details on how calabash handles alert dialog? 

Thanks

Tammy 

On Sunday, September 23, 2012 11:48:30 AM UTC-7, Jonas Maturana Larsen wrote:

Jonas Maturana Larsen

unread,
Sep 28, 2012, 2:22:36 AM9/28/12
to calabash...@googlegroups.com
I'm not sure I understand what kind of alert dialogs you mean.
Are we talking about android.app.AlertDialog?

- Jonas

Tam

unread,
Sep 28, 2012, 8:41:02 PM9/28/12
to calabash...@googlegroups.com

Yes, it is android.app.AlertDialog .

Jonas Maturana Larsen

unread,
Sep 29, 2012, 12:09:36 AM9/29/12
to calabash...@googlegroups.com
Then it should just work.

However, if I remember correctly the alert dialog splits the text into separate lines.
If you see:
Hello
World


You have to assert for "Hello\nWorld".

This is just a weak memory so I'm not 100% sure about it.


- Jonas

Tam

unread,
Oct 18, 2012, 7:11:33 PM10/18/12
to calabash...@googlegroups.com
Follow up. It works. There was something else wrong in my script. 

And I wait to see "xyz" , only works when pass first line of the message,  adding "\n" doesn't help retrieve second line of the message. But if you use "I should see 'abcdef....", it will retrieve all the messages even if the message display in multiple lines. 

Thanks 
Reply all
Reply to author
Forward
0 new messages