def open_connection(self): start_time = time.time() timeout = timestr_to_secs(self.timeout) while time.time() - start_time < timeout: try: self.remote_lib = RobotRemoteLibrary(self.uri) return except (BeanCreationException, RemoteConnectFailureException): time.sleep(2) message = "Could not get connection to '%s' in '%s'!" raise RuntimeError(message % (self.uri, self.timeout))
def _open_connection(self): self._remote_lib = RobotRemoteLibrary(self._uri)