=== modified file 'components/AddLocationSheet.qml'
--- components/AddLocationSheet.qml	2013-07-19 11:39:31 +0000
+++ components/AddLocationSheet.qml	2013-08-04 02:28:28 +0000
@@ -111,6 +111,7 @@
                     anchors.fill: parent;
                     model:  citiesModel;
                     delegate: ListItem.Standard {
+                        objectName: "searchResult" + index
                         text: i18n.tr(name)+((country) ? ', '+i18n.tr(country): '');
                         progression: true;
                         onClicked: {

=== modified file 'components/LocationManagerSheet.qml'
--- components/LocationManagerSheet.qml	2013-07-23 21:20:11 +0000
+++ components/LocationManagerSheet.qml	2013-08-04 02:28:28 +0000
@@ -105,6 +105,7 @@
                 visible: false
                 text: i18n.tr("London")
                 control: Button {
+                    objectName: "currentLocationItem"
                     id: lookupItemAddButton
                     anchors.verticalCenter: parent.verticalCenter
                     text: i18n.tr("add")
@@ -144,6 +145,7 @@
                     anchors.fill: parent
                     model: locationModel
                     delegate: ListItem.Standard {
+                        objectName: "existingLocation" + index
                         text: model.name
                         removable: true
                         onItemRemoved: {

=== modified file 'tests/autopilot/ubuntu_weather_app/tests/test_locationmanager.py'
--- tests/autopilot/ubuntu_weather_app/tests/test_locationmanager.py	2013-07-19 11:39:31 +0000
+++ tests/autopilot/ubuntu_weather_app/tests/test_locationmanager.py	2013-08-04 02:28:28 +0000
@@ -9,12 +9,15 @@
 
 from __future__ import absolute_import
 
-from testtools.matchers import Equals
+from testtools.matchers import Equals, NotEquals
 from autopilot.matchers import Eventually
 
 from ubuntu_weather_app.tests import WeatherTestCase, DatabaseMixin, SheetMixin
 from ubuntu_weather_app.tests.weatherdata import locations_data
 
+from time import sleep
+
+
 class TestLocationManager(WeatherTestCase, DatabaseMixin, SheetMixin):
     def setUp(self):
         self.clean_db()
@@ -33,6 +36,18 @@
         addLocPage = self.main_window.get_object("DefaultSheet", "AddLocationSheet")
         self.assertThat(addLocPage.visible, Eventually(Equals(True)))
 
+    def select_single_retry(self, object_type, **kwargs):
+        """Returns the item that is searched for with app.select_single
+        In case of the item was not found (not created yet) a second attempt is
+        taken 1 second later."""
+        item = self.app.select_single(object_type, **kwargs)
+        tries = 10
+        while item is None and tries > 0:
+            sleep(0.2)
+            item = self.app.select_single(object_type, **kwargs)
+            tries = tries - 1
+        return item
+
     def test_add_location(self):
         """Adds a location"""
         self._open_add_location_page()
@@ -79,8 +94,7 @@
 
         # insert city name to search for
         searchField = self.main_window.get_object("TextField", "SearchField")
-        self.pointing_device.move_to_object(searchField)
-        self.pointing_device.click()
+        self.pointing_device.click_object(searchField)
         self.keyboard.type("London")
         self.assertThat(searchField.text, Eventually(Equals("London")))
         self.keyboard.press_and_release('Enter')
@@ -88,19 +102,19 @@
         # wait for results and click on the first item
         resultsList = self.main_window.get_object('QQuickListView', 'SearchResultList')
         self.assertThat(resultsList.visible, Eventually(Equals(True), timeout=30))
-        firstResult = resultsList.get_children()[0].get_children()[0]
+        firstResult = self.select_single_retry("Standard", objectName="searchResult0")
         self.assertThat(firstResult.text, Eventually(Equals("London, GB")))
 
         # clear search field and do another search
-        for x in range(6):
-            self.keyboard.press_and_release('BackSpace')
+        clear_button = searchField.select_single("AbstractButton")
+        self.pointing_device.click_object(clear_button)
         self.assertThat(searchField.text, Eventually(Equals("")))
+
+        self.pointing_device.click_object(searchField)
         self.keyboard.type("Hamburg")
         self.keyboard.press_and_release('Enter')
-        # move the cursor to gain some time
-        self.pointing_device.move_to_object(resultsList)
-        self.pointing_device.move_to_object(searchField)
-        firstResult = resultsList.get_children()[0].get_children()[0]
+        self.assertThat(resultsList.visible, Eventually(Equals(True), timeout=30))
+        firstResult = self.select_single_retry("Standard", objectName="searchResult0")
         self.assertThat(firstResult.text, Eventually(Equals("Hamburg, DE")))
 
     def test_cancel_adding_location(self):
@@ -140,19 +154,32 @@
 
     def _open_location_manager(self):
         """Opens the location manager"""
+        toolbar = self.main_window.get_toolbar()
         self.main_window.open_toolbar()
-        self.assertThat(self.main_window.get_toolbar().opened, Eventually(Equals(True)))
+        self.assertThat(toolbar.animating, Eventually(Equals(False)))
+        self.assertThat(toolbar.state, Eventually(Equals("spread")))
         self.main_window.click_toolbar_button("EditButton")
+        location_manager_sheet = self.main_window.get_object(
+            "ComposerSheet", "LocationManagerSheet")
+        self.assertThat(location_manager_sheet.opacity, Eventually(Equals(1)))
 
     def _swipe_location_to_remove(self):
         """Swipe right to delete the first location"""
-        locationList = self.main_window.get_object('QQuickListView', 'LocationList')
-        locItem = locationList.get_children()[0]
-        loc_x, loc_y, loc_w, loc_h = locItem.globalRect
-        self.pointing_device.move(loc_x + 10, loc_y + loc_h / 2)
-        self.pointing_device.press()
-        self.pointing_device.move(loc_x + loc_w - 10, loc_y + loc_h / 2)
-        self.pointing_device.release()
+        number_of_locations = self._get_number_of_locations()
+        firstLocation = self.app.select_single("Standard", objectName="existingLocation0")
+        
+        x, y, w, h = firstLocation.globalRect
+        tx = x + (w / 8)
+        ty = y + (h / 2)
+
+        self.pointing_device.drag(tx, ty, w - (w / 8), ty)
+        self.assertThat(
+            self._get_number_of_locations(),
+            Eventually(Equals(number_of_locations-1)))
+
+    def _get_number_of_locations(self):
+        qqlw = self.app.select_single("ComposerSheet").select_single("QQuickListView")
+        return qqlw.count
 
     def test_remove_location(self):
         """Removes location"""
@@ -173,7 +200,7 @@
         load_indicator = self.main_window.get_object('ActivityIndicator', 'LoadingSpinner')
         self.assertThat(load_indicator.running, Eventually(Equals(False)))
         tabObjects = self.main_window.get_objects('LocationTab','LocationTab')
-        self.assertEqual(tabsSumStart-1, len(tabObjects))
+        self.assertThat(lambda: tabsSumStart-1, Eventually(Equals(len(tabObjects))))
 
     def test_cancel_remove_location(self):
         """Cancels removing of location"""

