sitespeedio / sitespeed.io

sitespeed.io is an open-source tool for comprehensive web performance analysis, enabling you to test, monitor, and optimize your website’s speed using real browsers in various environments.
https://www.sitespeed.io/
MIT License
4.76k stars 603 forks source link

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

Open Dharsh08 opened 2 days ago

Dharsh08 commented 2 days ago

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 commented 2 days ago

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