Fwd: [Paste] About Selenium & WebTest

4 views
Skip to first unread message

Tarek Ziadé

unread,
Aug 23, 2011, 6:02:03 AM8/23/11
to MoPy
---------- Forwarded message ----------
From: Gaël Pasgrimaud <gael.pa...@gmail.com>
Date: Tue, Aug 23, 2011 at 10:01 AM
Subject: [Paste] About Selenium & WebTest
To: Paste Users <paste...@googlegroups.com>


Hi,

This was originaly sent to Ian but as he suggested I also have to let
 you know what happen.

Don't know if you have notice that but I've added a sel.py module in
webtest to allow to use the webtest api with selenium

This mean that standard html pages/form can be tested with selenium
without any changes in your test. You just need to use the SeleniumApp
instead of the TestApp.

After that, there is also an extra api to test ajax stuff. Basically
I've added a .doc attribute to the response to manipulate the DOM.

The SeleniumApp can be used with an url or with a WSGI application.
WSGI applications are served by a simplewsgi_server in a separate
thread

As the tests show, you can use:

- the Selenium app[1]
- a method decorator so that self.app will become a SeleniumApp for this test[2]
- a context manager to run a part of your test in selenium[3]

Selenium tests are skipped if the selenium-rc server is not running.

Of course this need improvements but it's usable already. Hope you'll
like this idea.
I can always move that stuff to a separate package but.. it's very
closed to webtest and this package already have a good visibility.
Also, thanks to Python. I think that this can become one of the most
user friendly api for selenium.

The API is still totally open since there is no release already so do not
 hesitate if you have some suggestion about what the API should be.

Ho, I've also added Form.lint(). This do a few sanity checks to assure
that you have an id and a label for each fields.

Regards,

Gael

[1] https://bitbucket.org/ianb/webtest/src/7fea50513c77/tests/test_selenium.py#cl-138
[2] https://bitbucket.org/ianb/webtest/src/7fea50513c77/tests/test_selenium.py#cl-72
[3] https://bitbucket.org/ianb/webtest/src/7fea50513c77/tests/test_selenium.py#cl-54

--
You received this message because you are subscribed to the Google
Groups "Paste Users" group.
To post to this group, send email to paste...@googlegroups.com.
To unsubscribe from this group, send email to
paste-users...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/paste-users?hl=en.


--
Tarek Ziadé | http://ziade.org

David Burns

unread,
Aug 23, 2011, 10:41:00 AM8/23/11
to MoPy
I have commented on that thread on paste if people are interested.

David

David Burns
http://www.theautomatedtester.co.uk
> [1]https://bitbucket.org/ianb/webtest/src/7fea50513c77/tests/test_seleni...
> [2]https://bitbucket.org/ianb/webtest/src/7fea50513c77/tests/test_seleni...
> [3]https://bitbucket.org/ianb/webtest/src/7fea50513c77/tests/test_seleni...
>
> --
> You received this message because you are subscribed to the Google
> Groups "Paste Users" group.
> To post to this group, send email to paste...@googlegroups.com.
> To unsubscribe from this group, send email to
> paste-users...@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/paste-users?hl=en.
Reply all
Reply to author
Forward
0 new messages