Q:

[xpath]Need help in getting xpath for a table row next to another

EDIT: Why was this voted down? I really have no idea... BTW ../ does not work since i don't want the parent of the Table but want actually ../td+1 i don't know if that is even possible? 
Hi guys.
I have a fairly complex problem at hand..
I have a table like this: 
Name | Result | AutotestID | AutotestResult | AutotestName
X | Pass | X86HZS1 | | |
So... What i want to do is the following. I know only the ID. And i'd like to update the AutotestResult from an autotest. Which is empty to begin with.
I'm trying to locate the ID... I have that. But then when i have the ID i must update the Row next to it. How do i do that? I tried playing with the xPath. Stepping backwards using ../../../td etcetc but with no luck. 
I can't seem to find its neighboring table...
Could somebody please point me into the right direction? 
Thanks very much for every help!
Hannibal 

A:

Besides jasso's good recommendation of following-sibling axis, there is some problem with that answer: you must fix what td is the AutotestID.
So, knowing the table' schema:
<table> 
  <tr> 
    <td>Name</td> 
    <td>Result</td> 
    <td>AutotestID</td> 
    <td>AutotestResult</td> 
    <td>AutotestName</td> 
  </tr> 
  <tr> 
    <td>X</td> 
    <td>Pass</td> 
    <td>X86HZS1</td> 
    <td></td> 
    <td></td> 
  </tr> 
</table> 

You could use:
/table/tr/td[3][.='X86HZS1']/following-sibling::td[1]

or
/table/tr[td[3]='X86HZS1']/td[4]

If you don't know the AutotestID position, you could use:
/table/tr/td[count(../../tr/td[.='AutotestID']/preceding-sibling::td)+1]
            [.='X86HZS1']/following-sibling::td[1]

