webdriver.dart icon indicating copy to clipboard operation
webdriver.dart copied to clipboard

Support getting current timeouts in sync w3c drivers.

Open parren-google opened this issue 2 years ago • 5 comments

Uses the W3C "Get Timeouts" API: https://www.w3.org/TR/webdriver1/#get-timeouts

There is no such API in the JSON API: https://www.selenium.dev/documentation/legacy/json_wire_protocol/#command-summary

Rationale: Allows sync clients to temporarily change a timeout and then restore it back to what it was before (which doesn't work for async clients anyway).

Tested: Against geckodriver, and internally against Chrome.

Implements #280.

parren-google avatar Sep 25 '23 15:09 parren-google

@devoncarew do you know the best person to review this?

iinozemtsev avatar Sep 26 '23 10:09 iinozemtsev

Allows sync clients

I had the understanding we wanted to move away from the sync client. The sync_http package it relies on is pretty hacky IIRC, and there are significant risks around blocking the isolate while waiting for webdriver requests.

Why are we adding new sync-only features?

which doesn't work for async clients anyway

Why doesn't it work for async clients?

natebosch avatar Oct 05 '23 18:10 natebosch

which doesn't work for async clients anyway

Why doesn't it work for async clients?

@parren-google - can you help me understand this constraint?

natebosch avatar Dec 29 '23 02:12 natebosch

which doesn't work for async clients anyway

Why doesn't it work for async clients?

@parren-google - can you help me understand this constraint?

Sorry, that was a misunderstanding from my side. I thought the async driver used the JSON API. But it can also use W3C, so we can support getting timeouts in the aysnc driver too.

parren-google avatar Jan 16 '24 18:01 parren-google

which doesn't work for async clients anyway

Why doesn't it work for async clients?

@parren-google - can you help me understand this constraint?

Sorry, that was a misunderstanding from my side. I thought the async driver used the JSON API. But it can also use W3C, so we can support getting timeouts in the aysnc driver too.

However, the current async_timeouts_test.dart uses defaultSpec from common_config.dart, which is WebDriverSpec.JsonWire. Should we then introduce W3C variants of the async tests? Or switch to WebDriverSpec.Auto?

parren-google avatar Jan 18 '24 07:01 parren-google