How do you select last object?

Below is a list of possible Targets, each page has a different number of lines. How would you go about selecting only the last line?

Some have 4 like below, this number varies for each page.

xpath=//[@id=“Test-Sample”]/tbody/tr[1]/td
xpath=//
[@id=“Test-Sample”]/tbody/tr[2]/td
xpath=//[@id=“Test-Sample”]/tbody/tr[3]/td
xpath=//
[@id=“Test-Sample”]/tbody/tr[4]/td

Post url page and i find the solution

your question do not explan the problem

Post url page and good description of work to do.

I have 3 pages with the following targets as options. For page 1 i need to only capture the 4rth target, page 2 I need to capture the 8th target, page 3 I need to capture the 2nd target. How would I force it to target the last object of these sections?

Page 1
xpath=// [@id=“Test-Sample”]/tbody/tr[1]/td
xpath=//
[@id=“Test-Sample”]/tbody/tr[2]/td
xpath=// [@id=“Test-Sample”]/tbody/tr[3]/td
xpath=//
[@id=“Test-Sample”]/tbody/tr[4]/td

Page 2
xpath=// [@id=“Test-Sample”]/tbody/tr[1]/td
xpath=//
[@id=“Test-Sample”]/tbody/tr[2]/td
xpath=// [@id=“Test-Sample”]/tbody/tr[3]/td
xpath=//
[@id=“Test-Sample”]/tbody/tr[4]/td
xpath=// [@id=“Test-Sample”]/tbody/tr[5]/td
xpath=//
[@id=“Test-Sample”]/tbody/tr[6]/td
xpath=// [@id=“Test-Sample”]/tbody/tr[7]/td
xpath=//
[@id=“Test-Sample”]/tbody/tr[8]/td

Page 3
xpath=// [@id=“Test-Sample”]/tbody/tr[1]/td
xpath=//
[@id=“Test-Sample”]/tbody/tr[2]/td

It’s simple use storexpathcount to know number of xpath after you choice the latest

https://ui.vision/rpa/docs/selenium-ide/storexpathcount

How would you set it to only do the section listed and not the entire page?

Your explanation is confusing and unclear, please indicate the site’s full url is well-founded to understand what you need to do and to find better xpath. I have already solved similar cases in the forum, search and you will find that I have already solved similar cases.

I solved this similar case with success

Below are sample targets, what should be entered in the target line of storeXpathCount to result with a count of 3 for this section?

xpath=//tr[1]/td
xpath=//tr[2]/td
xpath=//tr[3]/td

You must add in storeXpathCoun a generic xpath like this

xpath=//tr/td
or
xpath=//tr

Or another xpath but you don’t added the page and i can not find another good xpath.