2 Replies Latest reply on Sep 17, 2007 10:26 AM by Polly McEldowney

    is it possible to access JSF UI components from seam testng

    Polly McEldowney Newbie

      hi,

      I'm wondering if there is any way of getting a handle on the jsf component model from a seam testng test script - so I can see if components are there, if they are rendered etc.

      i tried this in my Seam test class:

      @Override
       protected void renderResponse() {
      
       log.info("examining view root for components");
      
       List<UIComponent> components = getFacesContext().getViewRoot().getChildren();
       for (UIComponent comp : components) {
       log.info("found component: "+comp.getId());
       }
       log.info("child count: "+getFacesContext().getViewRoot().getChildCount());
       }


      but I just get this output:


      11:25:50,122 INFO [TestClass] examining view root for components
      11:25:50,122 INFO [TestClass] child count: 0


      am wondering if this sort of thing is possible, or maybe I am getting a bit carried away and it is outside the scope of what integration tests were intended to be used for? :)