Comments (7)
I think TimeoutConfiguration::default() could be used as the default (both internally and also people can use it to infer the defaults later if needed).
As I've said before, the plan with thirtyfour_query
was to merge it into thirtyfour
and make it a standard feature. It's probably time to make that happen. I'm not sure how to deal with timeouts though. The easiest way is to just set the default implicit wait to 0 and mention it in the docs. This is a breaking change but in my opinion it is a better default because implicit waits are not as convenient (i.e. when verifying that an element doesn't exist). There are also some other changes in the current main branch that are also breaking changes so now is as good a time as any. It probably needs a warning label in the documentation.
from thirtyfour.
Regarding removing boilerplate from the thirtyfour_query
setup, I've now merged thirtyfour_query
into the main branch, so it's available out-of-the-box without any setup. The default implicit wait time is now 0 and the default poller is ElementPoller::TimeoutWithInterval(Duration::from_secs(20), Duration::from_millis(500))
(using ElementPoller::default()). You can set a different poller via WebDriver::set_query_poller()
This means you can now use WebDriver::query()
, WebElement::query()
and WebElement::wait_until()
without any boilerplate setup and it will just work. The traits are also part of the prelude so you don't need to use
them specifically.
I suspect the existence of find_element()
etc alongside query()
may confuse some people though. I'm not really sure how to address that. I may need to make a distinction between lower vs higher level abstractions within WebDriver/WebElement. My preference is to steer people towards the higher-level abstractions but still allow access to the lower-level ones if needed and for those who know what they're doing.
I haven't published v0.25 yet.
from thirtyfour.
By the way it would be also helpful to have some clean method after usage of thirtyfour_query
to not have a boilerplate code with a remove of ElementPoller
from config and setting default timeouts.
What do you think?
from thirtyfour.
I think I may have misunderstood your later comment. Were you thinking that WebDriverConfig
should have a clean()
method or similar? or perhaps that method could exist on WebDriver
itself?
from thirtyfour.
I've implemented Default
for TimeoutConfiguration
. I also added a way to clear the WebDriverConfig
, but it requires mutable access to WebDriver
which may pose a challenge. I don't see this as an urgent thing since in the majority of cases it's better to end the session and create a new browser instance rather than try to keep one session open and reuse it.
However if we want to allow the configuration to be updated at any time, then I would suggest putting the entire WebDriverSession inside a mutex i.e. Arc<Mutex<WebDriverSession>>
. That should work ok I think. Actually a RwLock may be better since config writes will be quite rare.
from thirtyfour.
I think I may have misunderstood your later comment.
I was just thinking that things we need to set up to use a thirtyfour_query and to switch to default behavior could be hidden by some functions.
But never mind 😉 don't worry to much about it
from thirtyfour.
looking forward 0.25 :)
from thirtyfour.
Related Issues (20)
- so, how to get the text value of an element HOT 1
- Error while clicking element. HOT 4
- `#shadow-root` doesn't work on Firefox with geckodriver HOT 1
- Connection refused when using containers HOT 4
- How to use selenium-manager in my code? HOT 2
- thread 'tokio-runtime-worker' panicked at 'internal error: entered unreachable code: received unknown error (no such frame) for NOT_FOUND status code' HOT 4
- How can I set the user-agent for Chromedriver? HOT 3
- Is there a way to use wait_until or something like it to way for a specific ID to be available ? HOT 2
- wait until element to disappear HOT 6
- Chrome Options example erroring HOT 2
- Does `query` work on child elements? HOT 3
- Cannot interact with WebElement HOT 1
- How to trigger onchange event without submitting the form? HOT 2
- How to set PageLoadStrategy::None in DesiredCapabilities::chrome()? HOT 1
- Running the Test without Existing Browser (HtmlUnitDriver) HOT 1
- Add cdp type from auto_generate_cdp crate HOT 2
- How to handle file picker? HOT 4
- How to capture the Chromium's requests and responses traffic using thirtyfour HOT 5
- Maintenance Status
- Device Farm incompatibility - with workaround
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thirtyfour.