Would need more information to give a good answer, but some suggestions are below:
If you want to select the 5th <li>
in the entire HTML document:
xpath=/descendant::li[5]
I'm not sure what you mean by "I know li item ahead of time(such as @, +, * etc )" but if you know a unique attribute of the <li>
you can use that to locate it:
If you know the @id
of the <li>
:
id=knownId
If you know a CSS class of the <li>
:
css=li.knownClass
xpath=//li[contains(@class, 'knownClass']
If you know the text of the <li>
:
css=li:contains(knownText)
xpath=li[contains(text(), 'knownText')]
Hope that helps. Some more information - ideally a snippet of you HTML - would help to give a more specific answer.