title: How does the firebug identify the unique css path for selenium?
body: <p>When scripting automation with Selenium, I tried to locate a required web element with css selector, and I used the firebug to get the unique css path for that element. However, I was surprise since sometimes the firebug give me an incorrect css path although it works with selenium indeed.</p>
  
  <pre><code>&lt;table width="100%" cellspacing="1" cellpadding="4" border="0" class="forumline"&gt;
              &lt;tbody&gt;&lt;tr&gt;
                  &lt;th nowrap="nowrap" height="25" align="center" colspan="2" class="thcornerl"&gt;&amp;nbsp;Topic&amp;nbsp;&lt;/th&gt;
                  &lt;th width="50" nowrap="nowrap" align="center" class="thtop"&gt;&amp;nbsp;Answers&amp;nbsp;&lt;/th&gt;
                  &lt;th width="100" nowrap="nowrap" align="center" class="thtop"&gt;&amp;nbsp;Author&amp;nbsp;&lt;/th&gt;
                  &lt;th width="50" nowrap="nowrap" align="center" class="thtop"&gt;&amp;nbsp;Views&amp;nbsp;&lt;/th&gt;
                  &lt;th nowrap="nowrap" align="center" class="thcornerr"&gt;&amp;nbsp;Last message&amp;nbsp;&lt;/th&gt;
  
              &lt;/tr&gt;
  
              &lt;!-- TOPICS LISTING --&gt;
  
  
                  &lt;tr class="bg_small_yellow"&gt;
                      &lt;td width="20" valign="middle" align="center" class="row1Announce"&gt;                 &lt;img alt="" src="/jforum/images/transp.gif" class="icon_folder_announce"&gt;
  </code></pre>
  
  <p>
                          </p>
  
  <pre><code>                        &lt;span class="topictitle"&gt;
                          &lt;a href="/jforum/posts/list/2.page"&gt;
  
                              Support JForum - Please read
                          &lt;/a&gt;
                          &lt;/span&gt;
  
                      &lt;/td&gt;
  
                      &lt;td valign="middle" align="center" class="row2Announce"&gt;&lt;span class="postdetails"&gt;0&lt;/span&gt;&lt;/td&gt;
                      &lt;td valign="middle" align="center" class="row3Announce"&gt;
                          &lt;span class="name"&gt;&lt;a href="/jforum/user/profile/2.page"&gt;Admin&lt;/a&gt;&lt;/span&gt;
                      &lt;/td&gt;
  
                      &lt;td valign="middle" align="center" class="row2Announce"&gt;&lt;span class="postdetails"&gt;4&lt;/span&gt;&lt;/td&gt;
                      &lt;td valign="middle" nowrap="nowrap" align="center" class="row3Announce"&gt;
                              &lt;span class="postdetails"&gt;20/03/2016 13:58:24&lt;br&gt;
                              &lt;a href="/jforum/user/profile/2.page"&gt;Admin&lt;/a&gt;
  
  
                              &lt;a href="/jforum/posts/list/2.page#2"&gt;&lt;img border="0" alt="[Latest Reply]" src="/jforum/templates/default/images/icon_latest_reply.gif"&gt;&lt;/a&gt;&lt;/span&gt;
                      &lt;/td&gt;
  
                  &lt;/tr&gt;
  
  
                  &lt;tr class="bg_small_yellow"&gt;
                      &lt;td width="20" valign="middle" align="center" class="row1"&gt;                     &lt;img alt="" src="/jforum/images/transp.gif" class="icon_folder"&gt;
  </code></pre>
  
  <p>
                          </p>
  
  <pre><code>                        &lt;span class="topictitle"&gt;
                          &lt;a href="/jforum/posts/list/3.page"&gt;
                          [Poll]
                              Which one is your favorite?
                          &lt;/a&gt;
                          &lt;/span&gt;
  
                      &lt;/td&gt;
  
                      &lt;td valign="middle" align="center" class="row2"&gt;&lt;span class="postdetails"&gt;0&lt;/span&gt;&lt;/td&gt;
                      &lt;td valign="middle" align="center" class="row3"&gt;
                          &lt;span class="name"&gt;&lt;a href="/jforum/user/profile/3.page"&gt;yinzhenzhixin&lt;/a&gt;&lt;/span&gt;
                      &lt;/td&gt;
  
                      &lt;td valign="middle" align="center" class="row2"&gt;&lt;span class="postdetails"&gt;8&lt;/span&gt;&lt;/td&gt;
                      &lt;td valign="middle" nowrap="nowrap" align="center" class="row3"&gt;
                              &lt;span class="postdetails"&gt;20/03/2016 14:34:25&lt;br&gt;
                              &lt;a href="/jforum/user/profile/3.page"&gt;yinzhenzhixin&lt;/a&gt;
  
  
                              &lt;a href="/jforum/posts/list/3.page#4"&gt;&lt;img border="0" alt="[Latest Reply]" src="/jforum/templates/default/images/icon_latest_reply.gif"&gt;&lt;/a&gt;&lt;/span&gt;
                      &lt;/td&gt;
  
                  &lt;/tr&gt;
  
  
                  &lt;tr class="bg_small_yellow"&gt;
                      &lt;td width="20" valign="middle" align="center" class="row1"&gt;                     &lt;img alt="" src="/jforum/images/transp.gif" class="icon_folder"&gt;
  </code></pre>
  
  <p>
                          </p>
  
  <pre><code>                        &lt;span class="topictitle"&gt;
                          &lt;a href="/jforum/posts/list/1.page"&gt;
  
                              Welcome to JForum
                          &lt;/a&gt;
                          &lt;/span&gt;
  
                      &lt;/td&gt;
  
                      &lt;td valign="middle" align="center" class="row2"&gt;&lt;span class="postdetails"&gt;1&lt;/span&gt;&lt;/td&gt;
                      &lt;td valign="middle" align="center" class="row3"&gt;
                          &lt;span class="name"&gt;&lt;a href="/jforum/user/profile/2.page"&gt;Admin&lt;/a&gt;&lt;/span&gt;
                      &lt;/td&gt;
  
                      &lt;td valign="middle" align="center" class="row2"&gt;&lt;span class="postdetails"&gt;6&lt;/span&gt;&lt;/td&gt;
                      &lt;td valign="middle" nowrap="nowrap" align="center" class="row3"&gt;
                              &lt;span class="postdetails"&gt;20/03/2016 14:09:51&lt;br&gt;
                              &lt;a href="/jforum/user/profile/3.page"&gt;yinzhenzhixin&lt;/a&gt;
  
  
                              &lt;a href="/jforum/posts/list/1.page#3"&gt;&lt;img border="0" alt="[Latest Reply]" src="/jforum/templates/default/images/icon_latest_reply.gif"&gt;&lt;/a&gt;&lt;/span&gt;
                      &lt;/td&gt;
  
                  &lt;/tr&gt;
              &lt;!-- END OF TOPICS LISTING --&gt;
  
              &lt;tr align="center"&gt;
                  &lt;td valign="middle" height="28" align="right" colspan="6" class="catbottom"&gt;
                      &lt;table cellspacing="0" cellpadding="0" border="0"&gt;
                          &lt;tbody&gt;&lt;tr&gt;
                              &lt;td align="center"&gt;&lt;span class="gensmall"&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;
                          &lt;/tr&gt;
                      &lt;/tbody&gt;&lt;/table&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/tbody&gt;&lt;/table&gt;
  </code></pre>
  
  <p>I need the span which under the third tr whose class name is "bg_small_yellow". However, the firebug give me the unique css path as "tr.bg_small_yellow:nth-child(4) > td:nth-child(2) .topictitle > a:nth-child(1)", you see there are only 3 bg_small_yellow in total. where is the 4th one? How does it work?</p>