def render_body(self, body, timeout=0): self._driver.execute_script( 'setTimeout(function() { document.getElementsByTagName("body")[0].innerHTML = "' + body.replace('\n', ' ').replace('"', '\\"') + '";}, ' + str(convert_sec_to_ms(timeout)) + ');' ) return self
def execute_script_with_timeout(self, script, timeout): self._driver.execute_script( "setTimeout(function() { " + script.replace("\n", " ") + " }, " + str(convert_sec_to_ms(timeout)) + ");" ) return self
def execute_script_with_timeout(self, script, timeout): self._driver.execute_script('setTimeout(function() { ' + script.replace('\n', ' ') + ' }, ' + str(convert_sec_to_ms(timeout)) + ');') return self