Javatpoint Logo
Javatpoint Logo

Locating Strategies- (By XPath- Using last())

In this section, you will learn how to locate a particular web element by XPath- Using last() method.

"last() method" selects the last element (of mentioned type) out of all input element present.

Let us consider an example in which we will try to locate the last text field on the Google sign-up page i.e. "Confirm Password" field.

Locating Strategies- By XPath- Using last()

Using XPath- last() method, we can write the Java code along with the dynamic XPath location as:

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA