Documentation

Looking for something in particular?

Salesforce Lightning Web Component (LWC) Locator Support 

We’ve been working hard to deliver solutions that support Lightning Web Component (LWC) testing, and we have also made improvements in the pipeline designed to enhance this capability in the future. The following includes information about the unique challenges associated with testing Lightning Web Components and your options for testing Lightning Web Components using Provar.

The limitations of XPath and CSS locators


Sometimes, you may attempt to test web components within a web app and find that traditional XPath and CSS locators cannot locate an element. This is because the Shadow DOM encapsulates web components. Within the Shadow DOM, the elements within a web component are private, which means that XPath and CSS locators cannot access their elements – causing tests to fail. 

Using Provar to Test Lighting Web Components


If you’ve started to build and use Lightning Web Components in your Salesforce Lightning Experience enabled org, We provide the ability to test Lightning Web Components using NitroX. It automatically interprets the page structure and generates a unique locator path to locate elements that aren’t possible with standard XPath and CSS locators.

It simplifies testing by providing the capability to locate elements within a Lightning Web Component by generating Shadow DOM-compliant locators. This enables you to set, read, and assert the element’s value.

Testing Lightning Web Components with NitroX


The NitroX can locate a Lightning Web Component on a Salesforce page by constructing a custom JSON within Provar and locating the relevant element. Please refer to this support article for detailed information about using NitroX

Currently, you can use NitroX to test the following Lightning Web Components

Here’s the list of NitroX supported components.

If you want to learn more about using the Provar to test Lightning Web Components, please contact us to discuss your testing strategy and requirements at support@provartesting.com.


Feedback

Was this article helpful for you?
Documentation library

Trying to raise a case with our support team?

We use cookies to better understand how our website is used so we can tailor content for you. For more information about the different cookies we use please take a look at our Privacy Policy.

Scroll to Top