binzunu1909 / ui-test-selenium

Testing on Web API server about School Management
1 stars 0 forks source link

[Test] Index in XPath is one-based #4

Open Bisllly opened 1 year ago

Bisllly commented 1 year ago

The index in XPath is one-based, meaning the first element has an index of 1, the second has an index of 2, and so on.

In the XPath //table/tr[1]/td[4], tr[1] means the first row, and td[4] means the fourth cell in that row.

Jacobvu84 commented 1 year ago

//table/tr[1]/td[4]

if replacing 4 number is last() we have the last item in the list.

//table/tr[1]/td[last()]

Jacobvu84 commented 1 year ago

Refer: Predicates

image

@binzunu1909 @Bisllly

Jacobvu84 commented 1 year ago

Tham khảo thêm