diff --git a/MyTracksTest/src/com/google/android/apps/mytracks/endtoendtest/CreateAndSendTrackTest.java b/MyTracksTest/src/com/google/android/apps/mytracks/endtoendtest/CreateAndSendTrackTest.java index bdc25ef4e..67b3e8071 100644 --- a/MyTracksTest/src/com/google/android/apps/mytracks/endtoendtest/CreateAndSendTrackTest.java +++ b/MyTracksTest/src/com/google/android/apps/mytracks/endtoendtest/CreateAndSendTrackTest.java @@ -257,7 +257,7 @@ public class CreateAndSendTrackTest extends ActivityInstrumentationTestCase2 cc = EndToEndTestUtils.SOLO.getViews(); + ArrayList views = EndToEndTestUtils.SOLO.getViews(); int i = 0; - for (View view : cc) { + for (View view : views) { String name = view.getParent().getClass().getName(); - // Each share item is in one Linear layout which is the child view of - if (name.indexOf("RecycleListView") > 0) { + // Each share item is a child of a "RecycleListView" + if (name.indexOf(SHARE_ITEM_PARENT_VIEW_NAME) > 0) { if (index == i) { return view; } @@ -151,40 +153,38 @@ public class MenuItemsTest extends ActivityInstrumentationTestCase2