Comments (10)
Hi,
Can you please give some more details? Are you trying to invoke clickOnView()
with the same parameter many times? Do you use a goBack() between the clicks
etc etc.
Original comment by [email protected]
on 15 Nov 2010 at 1:10
from robotium.
I use following code to invoke it
public void testActivity(ActivityInstrumentationTestCase2<?> test,
Instrumentation ins, Activity ac) {
solo = new Solo(ins, ac);
Random random = new Random(1234);
int i = 0;
ArrayList<View> views=null;
Activity currentActivity = solo.getCurrentActivity();
Activity previousActivity=currentActivity;
while (i++ < 1000) {
Log.i(ACTESTER,""+i);
/*
* We must use getViews() each time to get new list of views
* because views on a single Activity may be updated
*/
views=solo.getViews();
if (currentActivity.hasWindowFocus()) {
View v = views.get(random.nextInt(views.size()));
if (v.isEnabled()&&v.isShown() ) {
Log.i(ACTESTER, "click "+v.toString());
try{
solo.clickOnView(v);
//TouchUtils.clickView(test, v);
}catch (Exception e) {
Log.i(ACTESTER,e.toString());
}
Log.i(ACTESTER, "finished click "+v.toString());
}
}else{
currentActivity=solo.getCurrentActivity();
if(currentActivity==previousActivity){
//some dialog pop up
solo.goBack();
Log.i(ACTESTER,"Go back");
}else{
//a new Activity is created on top of the task stack
previousActivity=currentActivity;
Log.i(ACTESTER, "Change Activity to "+currentActivity);
}
}
}
}
Original comment by [email protected]
on 15 Nov 2010 at 1:13
from robotium.
It happens when the code runs hundreds of times.
Original comment by [email protected]
on 15 Nov 2010 at 1:15
from robotium.
This does not occur when you use TouchUtils instead?
Original comment by [email protected]
on 15 Nov 2010 at 1:32
from robotium.
I mean the exact same test case but instead of solo.clickOnView using
TouchUtils.clickView(). How does that work?
Original comment by [email protected]
on 15 Nov 2010 at 1:33
from robotium.
TouchUtils is OK.
Original comment by [email protected]
on 15 Nov 2010 at 1:34
from robotium.
Replacing the call to solo.clickOnView() with TouchUtils.clickView() in the
code I provided and that is the way I used TouchUtils.clickView().
Original comment by [email protected]
on 15 Nov 2010 at 1:41
from robotium.
What happens is the following:
if(!view.isShown())
Assert.assertTrue("View is not visible and can therefore not be clicked!",
false);
Basically it asks the view if it is shown. And that is after it has waited for
5 seconds. So the view is telling Robotium that it is not shown (says so for 5
seconds). Therefore Robotium fails it as it will not be able to click it (it
thinks that it is not shown).
Original comment by [email protected]
on 15 Nov 2010 at 2:26
from robotium.
Thanks for this issue. This method will be rewritten in the next release.
Original comment by [email protected]
on 15 Nov 2010 at 3:47
- Changed state: Accepted
from robotium.
This issue has been resolved in Robotium 2.0
Original comment by [email protected]
on 7 Dec 2010 at 7:38
- Changed state: Verified
from robotium.
Related Issues (20)
- waitForActivity return false on robotium 5.2.1 HOT 4
- Spurious dialog button press when using solo.typeText(.). Not present when using solo.enterText(.). HOT 3
- solo.clickOnText finds the required text but treats it as a different text HOT 2
- solo.scrollDown() doesnt work on scrollable non ListViews/ScrollViews HOT 3
- TakeScreenshot with solo makes the keyboard and status bar disappear HOT 1
- clickLongInList does not work on a gridView HOT 3
- Can not launch testcases when apk is encrypted HOT 2
- Solo.pressMenuItem(int) clicking middle of screen HOT 1
- clickOnButton(String) working differently Debug vs Run in Android Studio HOT 4
- Cannot take screenshot on some devices. HOT 1
- Cannot browse to JDK Home with official Sun JDK on Mac Osx 10.10.3 HOT 1
- ConcurrentModificationException when calling Solo.finishOpenedActivities HOT 9
- WaitForView using resource id doesn't return until timeout is reached, even when a match is found HOT 4
- xpath result contains only one html node HOT 1
- Robotium Recorder failing to launch app on mobile device HOT 3
- Cannot Run robotium tests after save HOT 5
- ActivityUtils.getCurrentActivity() fails when dialog-styled activities change orientation HOT 1
- Unable start new Recording HOT 3
- When using Solo.clickOnActionBarHomeButton, can't click on text on the NavigationDrawer HOT 8
- Solo waitForDialogToOpen() continues on shown toast message HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from robotium.