Useful tip for Web Automation - Inspecting Web Elements & Understanding DOM using AI

Hi lovely people :heart:

So I was just doing some automation and was struggling to find one web element in Chrome Web browser, what I found is really interesting so I thought to share with you all here and I am confident that it will be useful tip for many of you if not already known :rocket: :purple_heart:

Chrome version:
Version 138.0.7204.101

Chrome has added built-in AI agent to ask anything regarding any web element and understand CSS like never before.

  1. Right Click to “Inspect the page”.
  2. You notice: “Ask AI”
  3. Click on it and ask the relevant question.
  4. Voila - you are set, no more struggles :sparkles:


Hope it helps! :heart:

11 Likes

Very lovely tip! :slight_smile:
Easy to use and easy to apply. Now time to deepdive to see what it can do! :smiley:

2 Likes

@aimantirmizi
Such a sweet tip! :blush: Super simple to try out—can’t wait to explore what more it can do! :grinning_face_with_smiling_eyes:

2 Likes

I immediately went through the chrome developer article after reading this post and thought of sharing here.

4 Likes

Just noticed you can only use this if you are logged in with gmail, so they can gather even more data! :smiley:

1 Like

… as we know they say: “If you are not paying for the product, you are the Product!” :grinning_face_with_smiling_eyes:

1 Like

Nice, thanks for sharing that.

Oh yes!
And not just for CSS the new AI integration in Chrome DevTools is going big!

In the Console tab, you can ask things like “What does this error mean?” and it’ll break down the root cause with possible fixes.
In the Network tab, it even helps generate structured bug reports for failed requests with request details, possible causes, severity, and suggested fixes.
And of course, in the Elements tab, CSS queries are now so much easier to handle with prompts like “Why isn’t this element visible?” or “How can I center this div?”.

3 Likes

100% - Thanks for sharing - this is the era of marvelous AI. Over centuries all the discoveries that there are - are to help us and AI is no different. Its up to us how we are going to utilize it. I am so excited with all the tools there are! Amazing time to be in world of testing and in general! :heart: :rocket: :purple_heart:

2 Likes

Time ago I was wondering if (Chrome) browser console was about to implement something similar to Copilot in their products, and then I noticed it few updates back along with the Accessibility Tree feature.

I used this feature a little bit and I liked it :smiley: .

2 Likes

I wonder if this AI has ability to help test automation engineers define or simplify the element locators. That is, if you try phrasing the questions in a way to get the AI to produce the locator or simplify it as an XPath or CSS value.

I know this has been a pain point (in the past, at least) among QA who are not well versed in XPath or CSS to custom tweak complex locators (often obtained from inspector tools) so that they are more flexible for use (e.g. template-ized for reuse to match multiple/different elements based on test scenario), easier to read/interpret, and less brittle to break against UI element changes.

I’d not used the AI assistance in DevTools before reading this, it looks really interesting. I’ve done a little post off this back of this based off my brief experience using it and intend to explore and write some more - thanks again for sharing!

3 Likes

@vivrichards

Glad, I read your bio, otherwise defo I thought, cricketer vivrichards at MoT under my blog post?! :smiley: lol.

Hi :waving_hand: First of all, I am honored to be mentioned in one of your blogs :slight_smile:

Without a doubt its an era of an AI, its important that we should not just blindly follow it, rather use it as co-pilot, helping agent, as a catalyst to make our day-to-day life easy. I do believe AI responses you without sometimes “context”, if not provided, its up to us to responsibly utilize that.
(There are AI prompt certifications for that reason and entire “Prompt Engineering” term is coined). How amazing?! :star_struck:

I also believe AI is here to help us not threaten us! Just like the first computer or the calculator, or machines in general to make human life easy. I am so looking forward to explore the AI in todays era! :sparkles: :star_struck:

Thanks once again for the appreciation & mention! :heart:

1 Like