-1

How to get xpath for the below to validate below text present i.e. 'Packages'

<div class="payment-ui__font18 payment-ui__pull-left payment-ui__display-block 
            Label__medium  Label__label-parent">
  <span class="Label__hidden-spoken" aria-hidden="false">Packages</span>
  <span aria-hidden="true">Packages</span>
</div>
yong
  • 11,757
  • 1
  • 10
  • 23

1 Answers1

0

A relative xpath is one where the path starts from the middle of the HTML DOM structure.

It doesn't need to start from the root node.

It starts with Double forward slash(//)

It can search the element anywhere at the webpage.

Example:

//*[@class=‘google']

In your case it would be

//*[@class='payment-ui__font18 payment-ui__pull-left payment-ui__display-block Label__medium Label__label-parent']

You can also see this stack overflow question for how to find the xpath using the inspector tools.

Is there a way to get the xpath in google chrome?

Julian Silvestri
  • 1,575
  • 1
  • 8
  • 27