Showing posts with label LLMs. Show all posts
Showing posts with label LLMs. Show all posts

Tuesday, March 31, 2026

Selenium, Playwright and XPath


I was asked this question.  
What are the types of XPath in Selenium?

I'm sure most would not be shocked by this question  Instead, take it as the right question from an interviewer.

As I heard this question, I asked myself.,
What are the types of XPath in Playwright?

Isn't that fair to ask so?


In simple, the Selenium and Playwright do not have their types of XPath.  In fact, the XPath has nothing to do with Selenium and Playwright.

The XPath was created by W3C before the Selenium came to the world.

The XPath is built by W3C and used by the browser to traverse a XML document.  

By the way, XPath means XML Path.  The XPath is an expression or query to locate the node or element or attribute or what is of interest in the XML document.

The creator of Selenium used the XPath to locate an web element on a web page which is a HTML document -- a XML.

The Playwright also does the same.  It uses the XPath to traverse and locate a web element on a web page.

However, XPath has two ways to traverse and locate a node in XML or a web element in HTML page.  That is,

  1. Absolute XPath
  2. Relative XPath
These are the two types offered by W3C to traverse a XML document using XPath.


LLM and Its Training for Software Test Engineering


The LLMs are trained by the data and information on internet.  When the internet is filled with such contents which are incorrect, noise, and misleading, the LLM offers the same.

In my opinion, that question asked about the types of XPath in Selenium and Playwright is technically incorrect.  Looks like the question is picked from the web or from a LLM's response.

The LLMs are useful when it is trained on the well reasoned information and data, and when it is questioned in the better ways.

The people are accepting whatever LLMs respond and advocating that is right!  Beware!

Let us give the better data to LLMs for its training.  This is very much needed to the Software Testing and Test Engineering related training.  




Question the LLMs in your prompts and conversation.  It can assist better.  You should know when to say no for what it is responding.  The XPath and its types are independent of any web automation libraries and tools.  The web automation libraries and tools make use of the XPath to traverse and locate a web element, a property or a attribute of an element in web page.

The latest XPath version available is 3.1.  It is said, the popular browsers which we use supports natively for XPath 1.0 alone.  That is, the popular browsers do not natively support the latest version of XPath.   The XPath 1.0 became a recommendation in 1999.


Friday, January 10, 2025

Caution! Know This Before You Prompt For Your Testing


My Fellow Test Engineers,


If you are using Gen AI and LLMs as an aid to do better work, yeah, we should be exploring it.  I have no second thoughts in it.

Are you giving anything bounded by NDA to Gen AI models and LLMs?
  • Like a part of software requirement, video, an image, code or anything that hints what the system is?
    • That is, is this part of your prompt text which you are giving to the Gen AI model(s) and other LLMs?  If so, do exercise the below questions:
      1. Do my organization and its business see any threat and risk from me for doing so?
      2. Does it violate the NDA (Non-Disclosure Agreement)? If yes, how will I be impacted and prosecuted by the employer's business and organization?
      3. Will I be terminated from my job or contract for doing this?
      4. Will I have to face the legal consequences?

I tell you, for today's LLMs, it is sufficient to have gist of requirement or code or video or an image to isolate one's request. From there, it can monitor fairly better with additional anticipation.


My questions:

  1. How would you trust the models behind?
  2. Do you know how it is observing especially when you use your business identity to login and prompt?
  3. Though you have customized the LLM's model and it is in within your environment, how do you know it is not connecting to its vendor environment and updating the gist?

Let us leverage the prompt engineering, Gen AI and associated LLMs. But, be aware and conscious of what we are giving out!


Also, be aware of what you tell to fellow test engineers. Not all Test Engineers or SDETs think of the consequences; instead just blindly mimic or follow what is being done or said to do by trying and using it.


Let us think about what we are passing to community by just saying to use prompts for --  to write test cases for this given requirement; read the given requirement and give a test design and strategy; review the code snippet and more.  Such loose and vague messages can be harmful if it is blindly followed!

By prompting the text and calling it out as prompt engineering, we might be giving out what we are not supposed to in the context of our employer's work. Caution!