I recommend using the "driven"/"scripted" mode of Selenium, in
particular the Twisted Server implementation. Details at
<http://agiletesting.blogspot.com/2005/03/web-app-testing-with-python-part-2.html>

Grig

--- Stephan Richter <[EMAIL PROTECTED]> wrote:

> Hi everyone,
> 
> I am trying to "mis"-use Selenium components as a simple
> cross-platform, 
> cross-browser blackbox to control aspects of the browser.
> 
> Okay here the full scoop. In Zope 3 we recently developed the 
> `zope.testbrowser` package, which allows us to write functional tests
> using a 
> Python class that simulates being a browser. Here a small example:
> 
>     >>> from zope.testbrowser import Browser
>     >>> browser = Browser()
>     >>> browser.addHeader('Authorization', 'Basic mgr:mgrpw')
>     >>> browser.addHeader('Accept-Language', 'en-US')
>     >>> browser.open('http://localhost/@@/testbrowser/simple.html')
>     >>> browser.url
>     'http://localhost/@@/testbrowser/simple.html'
> 
>     >>> browser.open('http://localhost/@@/testbrowser/navigate.html')
>     >>> link = browser.getLink('Link Text')
>     >>> link
>     <Link text='Link Text'
>     
>
url='http://localhost/@@/testbrowser/navigate.html?message=By+Link+Text'>
>     >>> link.text
>     'Link Text'
>     >>> link.url # it's normalized
>    
> 'http://localhost/@@/testbrowser/navigate.html?message=By+Link+Text'
>     >>> link.attrs
>     {'href': 'navigate.html?message=By+Link+Text'}
>     >>> link.click()
>     >>> browser.url
>    
> 'http://localhost/@@/testbrowser/navigate.html?message=By+Link+Text'
> 
> And this works great and I am very happy with it. However, now I
> would like to 
> develop another backend to the `Browser` class that actually opens a
> browser 
> of my choice and executes the `Browser` classes commands in the
> actual 
> Browser.
> 
> Clearly there are several ways to realize this, including DCOP (KDE
> only), 
> PyXPCOM (Mozilla-only) and JSSh (Mozilla-only). However, all of those
> 
> solutions have shortcomings, since they are platform and browser
> specific.
> Since the Zope community has embraced Selenium and several people
> told me to 
> look at selenium as another possibility, I really want to make all of
> this 
> work using Selenium. I have downloaded the SVN version and tried to
> read some 
> of the Javascript, but I am really lost.
> 
> I am looking for some hints, guidance, links or whatever to get this
> started.
> 
> Thanks for your help in advance!
> 
> Regards,
> Stephan
> -- 
> Stephan Richter
> CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
> Web2k - Web Software Design, Development and Training
> _______________________________________________
> Selenium-users mailing list
> Selenium-users@lists.public.thoughtworks.org
> http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users
> 

_______________________________________________
Selenium-users mailing list
Selenium-users@lists.public.thoughtworks.org
http://lists.public.thoughtworks.org/mailman/listinfo/selenium-users

Reply via email to