What are the various approaches to discover the component by CSS class?

503    Asked by ArunSharma in QA Testing , Asked on Jan 21, 2020
Answered by Arun Sharma

Say, the name of the CSS class is . At that point, the most basic approach to discover the component is as per the following.

//*[contains(@class, 'Text')]

On the off chance that you need an accurate correlation with abstaining from coordinating writings like "Text" or "MyTexting" at that point utilize this.

//*[contains(concat(' ', @class, ' '), ' MyText ')]

You can even utilize the capacity to evacuate any leading or trailing whitespaces.

//*[contains(concat(' ', standardize space(@class), ' '), 'MyText ')]



Your Answer

Interviews

Parent Categories