'Checks the number of \'patt\' occurrences in the current browser page'

def check_string_count_in_page(self, patt, min_count):

    page = self.last_page()
    patt_count = page.count(patt)
    if (patt_count < min_count):
        fname = self.write_temp_file(page)
        errmsg = ("%i    occurrences    of    '%s'    found    instead    of    %i.\npage    content    written    to    '%s'    " % (min_count, patt, patt_count, fname))
        raise AssertionError(errmsg)
