'Wait for scripts to be loaded and ready to work.'

def wait_script(self):

    tries = 100
    while tries:
        try:
            return self.browser.evaluate_script('$.select2')
        except:
            time.sleep(0.15)
        tries -= 1
    raise Exception('$.select2    was    not    defined    after    15    seconds.')
