Testing Splash screen

920 views
Skip to first unread message

dereulenspiegel

unread,
Aug 15, 2010, 8:26:15 AM8/15/10
to Robotium Developers
Hello,

I am new to robotium and unit testing general. In my application I
have a splash screen at start. Besides showing the name, version and
logo of the app some things like settings restore (after buying a new
device for example), license checking and so on happen in the
background. The next started activity behaves differently depending on
what happened while the splash was showing. How can I wait for an
activity to finish and then do stuff in another activity in robotium?
Thanks in advance.

Renas Reda

unread,
Aug 15, 2010, 9:13:26 AM8/15/10
to Robotium Developers
Hi,

You can use waitForText() if there is any text in the other activity
that you want to wait for. Also you can always check which Activity
that is currently active by using getCurrentActivity(). You can then
use it in a loop which is only exited when the Activity that you are
expecting is active.

/Renas


On Aug 15, 2:26 pm, dereulenspiegel <till.klo...@googlemail.com>
wrote:

Fabrizio Giudici

unread,
Aug 15, 2010, 9:26:44 AM8/15/10
to robotium-...@googlegroups.com, Renas Reda

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 8/15/10 15:13 , Renas Reda wrote:
> Hi,
>
> You can use waitForText() if there is any text in the other
> activity that you want to wait for. Also you can always check which
> Activity that is currently active by using getCurrentActivity().
> You can then use it in a loop which is only exited when the
> Activity that you are expecting is active.

I'm doing the latter thing, I've got a splashscreen too, and it works.

- --
Fabrizio Giudici - Java Architect, Project Manager
Tidalwave s.a.s. - "We make Java work. Everywhere."
java.net/blog/fabriziogiudici - www.tidalwave.it/people
Fabrizio...@tidalwave.it
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkxn6xQACgkQeDweFqgUGxemVwCfatgD9d5xpBN7GyEpwMzIHuga
VkoAoJot2HvrcoQ0yTzl3dI6x/uY2CFy
=a9C4
-----END PGP SIGNATURE-----

dereulenspiegel

unread,
Aug 18, 2010, 4:25:54 AM8/18/10
to Robotium Developers
Thanks that solution seems to work.

On 15 Aug., 15:26, Fabrizio Giudici <fabrizio.giud...@tidalwave.it>
wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 8/15/10 15:13 , Renas Reda wrote:> Hi,
>
> > You can use waitForText() if there is any text in the other
> > activity that you want to wait for. Also you can always check which
> > Activity that is currently active by using getCurrentActivity().
> > You can then use it in a loop which is only exited when the
> > Activity that you are expecting is active.
>
> I'm doing the latter thing, I've got a splashscreen too, and it works.
>
> - --
> Fabrizio Giudici - Java Architect, Project Manager
> Tidalwave s.a.s. - "We make Java work. Everywhere."
> java.net/blog/fabriziogiudici -www.tidalwave.it/people
> Fabrizio.Giud...@tidalwave.it
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
> Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org/
Reply all
Reply to author
Forward
0 new messages