2 Replies Latest reply on Dec 30, 2009 2:25 AM by Daniel Lechner

    Namespace of XHTML elements changes after they are rerendere

    Vlad Kravchenko Newbie

      We are using Richfaces in our application and test its UI with Selenium. Many test assertions are performed with XPath. The problem is that we have to use different XPath expressions before and after the Ajax call, because the elements reloaded by the Ajax call apper in an "x" namespace. Before the call they could be only found without specifiing any namespace.

      The issue can be observed on the Richfaces Live Demo. Go to the Data Iteration / Data Grid Demo.
      I am using XPath Checker Firefox plugin to get the XPath of an element.
      The XPath to the price value of the first car: id('j_id355:j_id356:0:j_id357_body')/table/tbody/tr[1]/td[2]

      Then I go to the next page and gets the XPath to the price value of the first car on that page:
      id('j_id355:j_id356:9:j_id357_body')/x:table/x:tbody/x:tr[1]/x:td[2]

      You can see that table and its child elements are now in x namespace.

      Could you explain that behavior? Can it be alerted in some way?