2016-04-05 17 views
2

私はエスプレッソでいくつかのテストを書いています。私はチェックボックスをクリックし、テストでそれをチェックしたい。しかし、私はできません。私はıdとcontentdescriptionで試しました。エスプレッソは見解を見出しましたが、実行できません。エスプレッソのチェックボックスをクリックできません

onView(withContentDescription("register check box 1")) 
         .check(matches(isNotChecked())) 
         .perform(click()) 
         .check(matches(isChecked())); 

このエラーが発生しました。

android.support.test.espresso.PerformException: Error performing 'sıngle click' on view 'with content description: is "register check box 1"'. 
at android.support.test.espresso.PerformException$Builder.build(PerformException.java:83) 
at android.support.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:70) 
at android.support.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:53) 
at android.support.test.espresso.ViewInteraction.runSynchronouslyOnUiThread(ViewInteraction.java:184) 
at android.support.test.espresso.ViewInteraction.doPerform(ViewInteraction.java:115) 
at android.support.test.espresso.ViewInteraction.perform(ViewInteraction.java:87) 
+1

あなた自身の質問に答えることができます。回答を投稿し、それを受け入れてください。あなたは解決策が見えにくいからです。ありがとう。 –

+0

Okıがそれを行います。 –

答えて

0

解決策が見つかりました。私の見解では、xmlのチェックボックスにその行があります。android:layout_marginLeft = " - 5dp"私はそれを削除し、完全に動作します。しかし、私は理由を理解することはできません。

関連する問題