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:






Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


B.Tech / MCA