title: Selenium 2.37 XPath, finding an item in a context menu, then clicking that item a second time
body: <p>In Selenium 2.37, I can click the "Open" item in a context menu, when I search for it in two steps: </p>
  
  <ol>
  <li>Find a few WebElement's by searching for the following XPath: </li>
  </ol>
  
  <p>td[@class=\"dijitReset dijitMenuItemLabel\" and " + "starts-with(@id,\"dijit_MenuItem_\")]</p>
  
  <ol>
  <li>Then, for each WebElement in this List of WebElement's, I do 
  String s = we.getText();  if (s.equals("Open") == true) { ... }</li>
  </ol>
  
  <p>This works fine. </p>
  
  <p>My problem is when I do the above "in one step", by including the text search in the XPath: </p>
  
  <p>td[@class=\"dijitReset dijitMenuItemLabel\" and " + 
  "starts-with(@id,\"dijit_MenuItem_\") and text()=\"Open\"]</p>
  
  <p>In this case, I do find the "Open" entry in the context menu, and I can click on it.  So far, so good.  So for finding the Open entry ONCE, and clicking on it ONCE, both the above methods work fine. </p>
  
  <p>The problem is that when I use the second method, then the NEXT time I want to bring up the context menu (for a different document) and click the Open menu item, the context menu appears.  BUT the mouse doesn't move down to the Open menu item, so the click never happens. </p>
  
  <p>This is all during a single WebDriver run, so the result is that I can open one document (the first document I see), its context menu appears, the mouse moves to the Open context menu item, and clicks it.  But then (same WebDriver run), when I get to the second document, the right-click happens, and the context menu appears, BUT the mouse does NOT move down to the Open menu item, so the click never happens.  </p>
  
  <p>Of course, for now, I'm using the first method.  But I would really prefer to use the second method, since if everything (including the text() match) is in a single XPath expression, I can look for that element in a WebDriverWait.  </p>
  
  <p>It's as if the Open menu item is (somehow) destroyed, detached from the DOM, or whatever, when the more complex XPath is used to find it. </p>
  
  <p>I only have this problem with items in CONTEXT menus. </p>
  
  <p>Any advice would be appreciated! </p>