Re: [robotium-developers] ClickOnView - Click can not be completed

357 views
Skip to first unread message

Renas

unread,
May 10, 2013, 4:53:22 AM5/10/13
to robotium-...@googlegroups.com
Hi,

Please see: "Why do text and button clicks get wrong?"


/Renas




On Fri, May 10, 2013 at 10:49 AM, Kais Khelifa <khelif...@gmail.com> wrote:
Hello,

when i do a solo.clickOnView(button) i get the error message :

junit.framework.AssertionFailedError: Click can not be completed!
at com.jayway.android.robotium.solo.Clicker.clickOnScreen(Clicker.java:85)
at com.jayway.android.robotium.solo.Clicker.clickOnScreen(Clicker.java:157)
at com.jayway.android.robotium.solo.Clicker.clickOnScreen(Clicker.java:131)
at com.jayway.android.robotium.solo.Solo.clickOnView(Solo.java:879)
at com.example.simplecalculator.test.testAddButton.testAddBtn(testAddButton.java:57)
at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:192)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:190)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:175)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1661)

in my xml file i have the following:

<EditText
        android:id="@+id/EDtxt1"
        android:inputType="numberDecimal"
        android:layout_width="250dp"
        android:layout_height="40dp"
        android:layout_gravity="center"
        android:hint="Enter First Number"/>
    
    
    <EditText
        android:id="@+id/EDtxt2"
        android:inputType="numberDecimal"
        android:layout_width="250dp"
        android:layout_height="40dp"
        android:layout_gravity="center"
        android:hint="Enter Second Number"/>
   
    <TextView
        android:id="@+id/resultTvID"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="No Result "
        android:textSize="25dp" />
    
    <Button 
        android:id="@+id/addBtnID"
        android:text="Addition"
        android:layout_width="150dp"
        android:layout_height="40dp"
        android:layout_gravity="center"/>

in my robotium test method i have this:
public testAddButton() {
		super(MainActivity.class);
	}

	protected void setUp() throws Exception {
		super.setUp();
		solo = new Solo(getInstrumentation(), getActivity());
	}

	protected void tearDown() throws Exception {
		super.tearDown();
	}
	
	@Test public void testAddBtn(){
		
		solo.waitForActivity("MainActivity");
	    
    
		Button msButton = (Button) solo.getCurrentActivity().findViewById(
				com.example.simplecalculator.R.id.addBtnID);
	    
	    
	    solo.clickOnView(msButton);
		
	}

Can anyone help me with this please
Thank you.

--
You received this message because you are subscribed to the Google Groups "Robotium Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotium-develo...@googlegroups.com.
To post to this group, send email to robotium-...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotium-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

naveed

unread,
May 24, 2013, 2:59:42 AM5/24/13
to robotium-...@googlegroups.com
Danny, 

Can you come up with your environmental details like, 
device version, Robotium version
error trace, logcat



On Thursday, May 23, 2013 11:09:06 PM UTC+5, Danny Roa wrote:

Where is the device manager?

I use a real device to run the test but Im getting the same error.


On Friday, May 10, 2013 8:38:35 AM UTC-7, Kais Khelifa wrote:
Hello Renas,

thank you for your help,
i fixed the issue, the problem is that i wasn't using a real device to run the test.
i changed the device in the device manager to Nexus S ( & it worked. 

regards,
Kais
To unsubscribe from this group and stop receiving emails from it, send an email to robotium-developers+unsub...@googlegroups.com.

Deepak Bansal

unread,
Jul 10, 2013, 7:55:02 AM7/10/13
to robotium-...@googlegroups.com
Hi Naveed,
 
I am facing same issue using Samsung device.
 
I am using roboitum 4.2 jars, Andorid 4.2 version.
 
Trace:
 
junit.framework.AssertionFailedError: Click can not be completed!
at com.jayway.android.robotium.solo.Clicker.clickOnScreen(Clicker.java:85)
at com.jayway.android.robotium.solo.Clicker.clickOnScreen(Clicker.java:157)
at com.jayway.android.robotium.solo.Clicker.clickOnText(Clicker.java:322)
at com.jayway.android.robotium.solo.Clicker.clickOnMenuItem(Clicker.java:199)
at com.jayway.android.robotium.solo.Solo.clickOnMenuItem(Solo.java:763)
at com.sec.android.app.launcher.test.Launcher_Test.test017_IconMoveToFolder(Launcher_Test.java:1293)

at java.lang.reflect.Method.invokeNative(Native Method)
at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214)
at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199)
at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:192)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:190)
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:175)
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1698)
 
 
 
Please help!
 
Regards,
Deepak


To unsubscribe from this group and stop receiving emails from it, send an email to robotium-develo...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages