[Zope3-dev] Re: Windows eggs

Benji York benji at zope.com
Sun Jul 15 11:26:52 EDT 2007


Stephan Richter wrote:
> I would not like that. I really, really like to use XPath to select an element 
> in the HTML structure. The method above would still require me to write

I think I miscommunicated.  Let me combine your example and mine to 
demonstrate what I was talking about.  Say you have an HTML document and 
you want to make assertions about a portion of it.  You could use XPath 
to extract part of the document and then use the smart ellipses to make 
assertions about it.  Like so:

     >>> browser.open(...)
     >>> Introspector(browser.contents).xpath('//foo')
     <foo ...>Text here</foo>

In the above example, the tester wants to extract the <foo> element, and 
assert that its contents are "Text here" and that there are no child 
elements.  They don't want to make any assertions about it's attributes 
so they put the ellipses there.  Is that example clearer?

> Of course, I really would prefer this:
> 
>   >>> print Introspector(browser).xpath1('//foo')
>   <foo a="b">Text here</foo>
> 
> This is so that the browser features and content inspection are separated.

Yep, I much prefer having this functionality in a separate object as 
well; it's not really testbrowser specific.
-- 
Benji York
Senior Software Engineer
Zope Corporation


More information about the Zope3-dev mailing list