From: W. Trevor King Date: Tue, 29 Jun 2010 12:46:21 +0000 (-0400) Subject: Allow a few tries for 'Home' to open in prof/import.py X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6fa1de3c2b35200c4d7a3086ca442c66363715d4;p=sitecorepy.git Allow a few tries for 'Home' to open in prof/import.py --- diff --git a/sitecore/prof/import.py b/sitecore/prof/import.py index bc5440b..46f74d3 100644 --- a/sitecore/prof/import.py +++ b/sitecore/prof/import.py @@ -22,6 +22,8 @@ Professors will be created in: Content -> Drexel -> ? -> physics -> ? """ +import time + from selenium.common.exceptions import NoSuchElementException import yaml @@ -39,7 +41,11 @@ class ProfessorAdder (object): #self.s.expand_nav_section('sitecore') #self.s.expand_nav_section('Content') self.s.expand_nav_section('Home') - self.s.expand_nav_section('physics') + for i in range(5): # 'physics' takes a while to load + try: + self.s.expand_nav_section('physics') + except NoSuchElementException, e: + time.sleep(self.s.wait_time) self.s.expand_nav_section('contact') self.s.expand_nav_section('facultyDirectory')