Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry pick PR #2140: Android blacboxtests fix, workaround for Python webdriver #2151

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions cobalt/tools/automated_testing/cobalt_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,13 @@ def _KillLauncher(self):
def _StartWebdriver(self, port):
host, webdriver_port = self.launcher.GetHostAndPortGivenPort(port)
self.webdriver_url = f'http://{host}:{webdriver_port}/'

# Create remote and set a timeout before making the connection
rc = self.selenium_webdriver_module.remote.remote_connection
executor = rc.RemoteConnection(self.webdriver_url)
executor.set_timeout(WEBDRIVER_HTTP_TIMEOUT_SECONDS)
self.webdriver = self.selenium_webdriver_module.Remote(
self.webdriver_url, COBALT_WEBDRIVER_CAPABILITIES)
self.webdriver.command_executor.set_timeout(WEBDRIVER_HTTP_TIMEOUT_SECONDS)
executor, COBALT_WEBDRIVER_CAPABILITIES)
logging.info('Selenium Connected')
self.test_script_started.set()

Expand All @@ -344,11 +348,12 @@ def ReconnectWebDriver(self):
if self.webdriver:
self.webdriver.quit()
if self.webdriver_url:
rc = self.selenium_webdriver_module.remote.remote_connection
executor = rc.RemoteConnection(self.webdriver_url)
executor.set_timeout(WEBDRIVER_HTTP_TIMEOUT_SECONDS)
self.webdriver = self.selenium_webdriver_module.Remote(
self.webdriver_url, COBALT_WEBDRIVER_CAPABILITIES)
executor, COBALT_WEBDRIVER_CAPABILITIES)
if self.webdriver:
self.webdriver.command_executor.set_timeout(
WEBDRIVER_HTTP_TIMEOUT_SECONDS)
logging.info('Selenium Reconnected')

def WaitForStart(self):
Expand Down
Loading