From 4e266228dbb1d6eba37d0c8b510e98a2e17d3094 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 30 Jun 2010 22:38:40 -0400 Subject: [PATCH] Use 'From Template' instead of 'Duplicate' to create new prof pages --- sitecore/prof/import.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/sitecore/prof/import.py b/sitecore/prof/import.py index 3b949a6..e488910 100644 --- a/sitecore/prof/import.py +++ b/sitecore/prof/import.py @@ -120,9 +120,14 @@ class ProfessorAdder (object): return except NoSuchElementException: pass - 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() + #self.s.w.find_element_by_link_text('Duplicate').click() + # WebDriver doesn't support JavaScript prompts: + # http://code.google.com/p/selenium/wiki/FrequentlyAskedQuestions#Q:_Does_support_Javascript_alerts_and_prompts? + self.s.open_nav_section('facultyDirectory') + self.s.w.find_element_by_link_text('Developer').click() + time.sleep(self.s.wait_time) + self.s.w.find_element_by_link_text('From Template').click() time.sleep(self.s.wait_time) windows = self.s.w.get_window_handles() current_window = self.s.w.get_current_window_handle() @@ -131,13 +136,14 @@ class ProfessorAdder (object): self.s.logger.info('handling copy popup %s (from %s, old %s)' % (popup, windows, current_window)) self.s.w.switch_to_window(popup) - filename = self.s.w.find_element_by_id('Filename') - filename.clear() - filename.send_keys( - '/sitecore/content/Home/physics/contact/facultyDirectory/%s' - % name) + template = self.s.w.find_element_by_id('TemplateName') + template.clear() + template.send_keys('/Drexel/FacultyProfile') + faculty = self.s.w.find_element_by_id('ItemName') + faculty.clear() + faculty.send_keys(name) self.s.w.find_element_by_id('OK').click() - time.sleep(self.s.wait_time) + time.sleep(self.s.wait_time*5) current_window = self.s.w.get_current_window_handle() self.s.logger.info('handled copy popup %s, back to %s' % (popup, current_window)) -- 2.26.2