@@ -18,17 +18,22 @@
1818#
1919
2020from unity8.shell.emulators import UnityEmulatorBase
21−
21+from time import sleep
2222
2323class Dash(UnityEmulatorBase):
2424
2525 """An emulator that understands the Dash."""
2626
2727 def get_home_applications_grid(self):
28− return self.get_scope('home').select_single(
29− "GenericFilterGrid",
30− objectName="applications.scope"
31− )
28+ for i in range(1,10):
29+ get_grid = self.get_scope('home').select_single(
30+ "GenericFilterGrid",
31+ objectName="applications.scope"
32+ )
33+ if get_grid != None:
34+ break
35+ sleep(1)
36+ return get_grid
3237
3338 def get_application_icon(self, text):
3439 """Returns a 'Tile' icon that has the text 'text' from the application
@@ -40,7 +45,11 @@ class Dash(UnityEmulatorBase):
4045
4146 """
4247 app_grid = self.get_home_applications_grid()
43− resp_grid = app_grid.select_single('ResponsiveGridView')
48+ for i in range(1,10):
49+ resp_grid = app_grid.select_single('ResponsiveGridView')
50+ if resp_grid != None:
51+ break
52+ sleep(1)
4453 return resp_grid.select_single('Tile', text=text)
4554
4655 def get_scope(self, scope_name='home'):