diff --git a/MyTracksTest_E2E/src/com/google/android/apps/mytracks/endtoendtest/EndToEndTestUtils.java b/MyTracksTest_E2E/src/com/google/android/apps/mytracks/endtoendtest/EndToEndTestUtils.java index c7bc6ac68..e5ad6d2d7 100644 --- a/MyTracksTest_E2E/src/com/google/android/apps/mytracks/endtoendtest/EndToEndTestUtils.java +++ b/MyTracksTest_E2E/src/com/google/android/apps/mytracks/endtoendtest/EndToEndTestUtils.java @@ -56,7 +56,7 @@ public class EndToEndTestUtils { private static final String ANDROID_LOCAL_IP = "10.0.2.2"; // usually 5554. - public static int emulatorPort = 5554; + public static int emulatorPort = 5568; private static final int ORIENTATION_PORTRAIT = 1; private static final int ORIENTATION_LANDSCAPE = 0; @@ -787,12 +787,14 @@ public class EndToEndTestUtils { */ public static TextView findTextView(String text) { ArrayList allViews = SOLO.getViews(); - for (View view : allViews) { - if (view instanceof TextView) { - TextView textView = (TextView) view; - String textString = (String) textView.getText(); - if (textView.isShown() && textString.endsWith(text)) { - return textView; + if (allViews != null) { + for (View view : allViews) { + if (view instanceof TextView) { + TextView textView = (TextView) view; + String textString = (String) textView.getText(); + if (textView.isShown() && textString.endsWith(text)) { + return textView; + } } } }