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

CSS selector command to click and add text in sitespeed.io #4326

Open
Dharsh08 opened this issue Nov 25, 2024 · 1 comment
Open

CSS selector command to click and add text in sitespeed.io #4326

Dharsh08 opened this issue Nov 25, 2024 · 1 comment

Comments

@Dharsh08
Copy link

Your question

My element(search bar) is inside shadow root, hence im unable to locate the xpath for it. As a workaround Im trying to click using css selector. Could you please help me with a command I can use to click search bar and add text using css selector?

Also any suggestions to click element which are inside shadow root and commands which could be used for sitespeed scripting?

Command used: await commands.click.bySelector('//example[@data-testid="nav-section-search-bar"]');
Error message : ERROR: Could not click using selector //example[@data-testid="nav-section-search-bar"]

@soulgalore
Copy link
Member

Can you do it with JavaScript directly to get hold of it? Using await commands.js.run('...'):?

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

No branches or pull requests

2 participants