From 6fa1de3c2b35200c4d7a3086ca442c66363715d4 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 29 Jun 2010 08:46:21 -0400 Subject: [PATCH] Allow a few tries for 'Home' to open in prof/import.py --- sitecore/prof/import.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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') -- 2.26.2