From: W. Trevor King Date: Wed, 30 Jun 2010 13:35:12 +0000 (-0400) Subject: Try to open prof section before creating it. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f61e9e5b385946db5e771a3693eb2c133eb772a9;p=sitecorepy.git Try to open prof section before creating it. --- diff --git a/sitecore/prof/import.py b/sitecore/prof/import.py index cd857a2..6faefcb 100644 --- a/sitecore/prof/import.py +++ b/sitecore/prof/import.py @@ -51,10 +51,12 @@ class ProfessorAdder (object): def __call__(self, prof): self.create_prof_page(prof) - self.s.open_nav_section(raw_name) TODO def create_prof_page(self, prof): + name = '%s %s' % (prof.name.first_middle, prof.name.last) + self.s.open_nav_section(name) + return self.s.open_nav_section('Copy of Shyamalendu Bose') old_windows = self.s.w.get_window_handles() self.s.w.find_element_by_link_text('Copy To').click() @@ -69,13 +71,14 @@ class ProfessorAdder (object): name = self.s.w.find_element_by_id('Filename') name.clear() name.send_keys( - '/sitecore/content/Home/physics/contact/facultyDirectory/%s %s' - % (prof.name.first_middle, prof.name.last)) + '/sitecore/content/Home/physics/contact/facultyDirectory/%s' + % name) self.s.w.find_element_by_id('OK').click() time.sleep(self.s.wait_time) current_window = self.s.w.get_current_window_handle() self.s.logger.info('handled copy popup %s, back to %s' % (popup, current_window)) + self.s.open_nav_section(name) def main(argv):