'Submit the form.'

def submit(self):

    sel = u'input[type=submit]'
    if (not self.in_popup):
        sel += u'[name=_continue]'
    el = self.case.browser.find_by_css(sel).first
    el.click()
    tries = 100
    while tries:
        if ((len(self.case.browser.windows) == 1) and self.in_popup):
            break
        try:
            el.visible
        except:
            break
        tries -= 1
        time.sleep(0.05)
    if (not self.in_popup):
        self.case.wait_script()
