def release_href_course(cfg,driver, base_url, org_name):
    
    rand_name = str(random.randint(1000,9999))
    an_title = u'外链了视频的公告'+rand_name
    
    driver.get(base_url + org_name)
    time.sleep(2)
    driver.find_element_by_xpath("//div[@id='orgTab']/div[2]/div[2]/a").click()
    time.sleep(2)
    driver.find_element_by_link_text(u"获取视频链接").click()
    href = driver.execute_script("return document.getElementsByTagName('textarea')[1].value")
    #print href
    
    an_content = href
    user_management.release_announcement(cfg, driver, base_url, org_name, an_title, an_content)
    
    return an_title
    
    def release_announcement(self):

        self.total += 1
        rand_name = str(random.randint(1000, 9999))
        title = u"announcement"+rand_name
        try:
            title = user_management.release_announcement(self.cfg, self.driver, self.base_url, self.org_name, title)
        except Exception, e:
            print traceback.format_exc() 
            self.verificationErrors.append("fail to release announcement!")
 def release_announcement(self):
     
     self.total += 1
     rand_name = str(random.randint(1000,9999))
     title = u"自动化公告"+rand_name
     try:
         title = user_management.release_announcement(self.cfg, self.driver, self.base_url, self.org_name, title)
         title = title +' new'
     except Exception,e:
         print e
         self.verificationErrors.append("fail to release announcement!")