Script works in Firefox but not with zope.testbrowser

153 views
Skip to first unread message

Mumbo Design

unread,
Jul 27, 2011, 3:31:14 PM7/27/11
to splinter-users
Hi,

First off, I'm a python newbie and have only been using it for a few
days, so please forgive me if it is a simple mistake.

I have a simple script, that when ran in firefox, works perfectly,
however I want to run it from within zope.testbrowser because as I
understand it, this means there won't be a visible browser window
actually performing the actions.

I have tried various things (to my newbie level), and as far as I can
tell the proxies list is empty, which is why the if statement isn't
working. I however don't understand why this would work with Firefox,
but not with Zope.

Code can be found here, along with the error at the bottom:http://
paste.pound-python.org/show/10129/

Any help appreciated.

Francisco Souza

unread,
Jul 27, 2011, 4:36:04 PM7/27/11
to splinte...@googlegroups.com
On Wed, Jul 27, 2011 at 4:31 PM, Mumbo Design <con...@mumbodesign.com> wrote:
Hi,

Hi there :)
 

First off, I'm a python newbie and have only been using it for a few
days, so please forgive me if it is a simple mistake.

I have a simple script, that when ran in firefox, works perfectly,
however I want to run it from within zope.testbrowser because as I
understand it, this means there won't be a visible browser window
actually performing the actions.

Exactly, zope.testbrowser is a headless driver, which means that it performs all browsing actions without opening a browser, being faster, but zope.testbrowser can't execute javascript, so you can't use zope.testbrowser to interact with js-based pages/components. 

I have tried various things (to my newbie level), and as far as I can
tell the proxies list is empty, which is why the if statement isn't
working. I however don't understand why this would work with Firefox,
but not with Zope.
 
Code can be found here, along with the error at the bottom:http://
paste.pound-python.org/show/10129/
 
The content of this page: http://www.samair.ru/proxy/proxy-1.htm is loaded using JavaScript, and as I wrote above, it's impossible to use zope.testbrowser to interact with content generated via JavaScript.

Keep hacking,
Chico (a.k.a Francisco Souza)
@franciscosouza

Mumbo Design

unread,
Jul 27, 2011, 7:12:23 PM7/27/11
to splinter-users
Hi,

Thanks for getting back to me. Are you aware of any headless browsers,
in which javascript can run? Even if they are not integrated within
splinter.

It really isn't ideal for my users to be seeing the browser working
away.

Thanks,
Jake

On Jul 27, 9:36 pm, Francisco Souza <franci...@franciscosouza.net>
wrote:
> On Wed, Jul 27, 2011 at 4:31 PM, Mumbo Design <cont...@mumbodesign.com>
>
>  wrote:
> > Hi,
>
> Hi there :)
>
>
>
> > First off, I'm a python newbie and have only been using it for a few
> > days, so please forgive me if it is a simple mistake.
>
> > I have a simple script, that when ran in firefox, works perfectly,
> > however I want to run it from within zope.testbrowser because as I
> > understand it, this means there won't be a visible browser window
> > actually performing the actions.
>
> Exactly, zope.testbrowser is a headless driver, which means that it performs
> all browsing actions without opening a browser, being faster, but
> zope.testbrowser can't execute javascript, so you can't use zope.testbrowser
> to interact with js-based pages/components.
>
> I have tried various things (to my newbie level), and as far as I can
>
> > tell the proxies list is empty, which is why the if statement isn't
> > working. I however don't understand why this would work with Firefox,
> > but not with Zope.
>
> Code can be found here, along with the error at the bottom:http://
>
> > paste.pound-python.org/show/10129/
>
> The content of this page:http://www.samair.ru/proxy/proxy-1.htmis loaded
> using JavaScript, and as I wrote above, it's impossible to use
> zope.testbrowser to interact with content generated via JavaScript.
>
> Keep hacking,
> Chico (a.k.a Francisco Souza)
> @franciscosouza
>

Francisco Souza

unread,
Jul 28, 2011, 9:37:49 AM7/28/11
to splinte...@googlegroups.com
Hi,
you can try one of the following headless browsers:


Cheers,

Chico (a.k.a Francisco Souza)
@franciscosouza


Reply all
Reply to author
Forward
0 new messages