Re: wait for application loading data

52 views
Skip to first unread message

naveed

unread,
May 22, 2013, 1:03:09 AM5/22/13
to robotium-...@googlegroups.com
You can use any of below

waitForView(android.view.View view)
waitForText(String text)
waitForText(String text, int minimumNumberOfMatches, long timeout)
waitForText(String text, int minimumNumberOfMatches, long timeout, boolean scroll)
waitForText(String text, int minimumNumberOfMatches, long timeout, boolean scroll, boolean onlyVisible)

then put some check like 
if(view available) do something 
else do something else

On Tuesday, May 21, 2013 4:20:37 PM UTC+5, i.del...@gmail.com wrote:
Hi everybody, 
i'm trying to test OsmAnd and everytime the testcase starts i get "loading data" message, and if as first istruction of the test case i try to click somewhere i get an exception. how can I wait for the application loading data before than test case starts? i've tryed solo.waitForDialogToClose(5000) but i still get the exeption. my first test istruction is clickOnText("Settings") where "Settings" is a button on the main menu but i get the exception junit.framework.AssertionFailedError: Text string: 'Settings' is not found! 
any ideas? 
thank's all

naveed

unread,
May 24, 2013, 3:02:57 AM5/24/13
to robotium-...@googlegroups.com
in case of TextView Robotium comes up with reasonable range of methods, use any of your choice to check availability.

booleansearchText(String text)
Searches for the specified text and returns true if at least one item is found displaying the expected text.
booleansearchText(String text, boolean onlyVisible)
Searches for the specified text and returns true if at least one item is found displaying the expected text.
booleansearchText(String text, int minimumNumberOfMatches)
Searches for the specified text and returns true if the searched text is found a specified number of times.
booleansearchText(String text, int minimumNumberOfMatches, boolean scroll)
Searches for the specified text and returns true if the searched text is found a specified number of times.
booleansearchText(String text, int minimumNumberOfMatches, boolean scroll, boolean onlyVisible)
Searches for the specified text and returns true if the searched text is found a specified number of times.

On Thursday, May 23, 2013 2:35:33 PM UTC+5, i.del...@gmail.com wrote:
first of all thank's for the answer!
second, how can I check  if( View available) ? 
Reply all
Reply to author
Forward
0 new messages