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

Forcing element states #249

Open
ollie-iterators opened this issue Jun 26, 2022 · 6 comments
Open

Forcing element states #249

ollie-iterators opened this issue Jun 26, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@ollie-iterators
Copy link

I have noticed that you can force an element to go into a certain state in the different browsers (Chrome, Firefox, Safari). I have tried to see how to do that with a webdriver, but it is impossible to find a way to do that without the Developer tools.

I think it would be a good feature to have the ability to force element state without using the developer tools for a browser.

@whimboo
Copy link
Contributor

whimboo commented Jul 7, 2022

@ollie-iterators could you please be more explicit about what your topic is? It would be helpful to have some code examples or links to get an understanding of your request. Thanks.

@jgraham
Copy link
Member

jgraham commented Jul 13, 2022

I'm not sure what "force the element state" means, or quite what devtools functionality you're referring to. Please reopen if you are able to provide more detail on the missing functionality.

@jgraham jgraham closed this as not planned Won't fix, can't repro, duplicate, stale Jul 13, 2022
@ollie-iterators
Copy link
Author

If you right click on an element in the browser (Chrome or FireFox), and click Inspect, then you will go to the developer tools. There will be an option visible on the screen called ":hov" which is near the text saying "Filter Styles". It allows you to force the element into a certain state. The states that the element can be forced to are: :hover, :active, :focus, :focus-visible, :focus-within, :visited, :target.

In Safari, you can right click on the element, press Inspect Element, which again goes to the developer tools. Right clicking on the code for an element shows a button in the user interface that says Change pseudo class. The pseudo classes that it can change to are the same as the ones for Chrome and FireFox

@whimboo
Copy link
Contributor

whimboo commented Dec 15, 2022

It sounds like that this is what CDP offers via:
https://chromedevtools.github.io/devtools-protocol/tot/CSS/#method-forcePseudoState

@ollie-iterators
Copy link
Author

Ok, but it would be good if there was an option to do that without CDP so that it could work on other browsers

@whimboo whimboo added the enhancement New feature or request label Dec 16, 2022
@whimboo
Copy link
Contributor

whimboo commented Dec 16, 2022

Sure, WebDriver BiDi is independent. My comment was just about a reference point that could be used when designing the API for that feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants