chicken satay (getting started with alfajor)

Sep 29, 2010 17:58


These are some pretty rough notes on some coding stuff I need to post somewhere.

Setting up alfajor:

$ virtualenv alfaj $ cd alfaj; . bin/activate $ pip install nose $ sudo aptitude install libxslt1-dev $ git clone git://github.com/idealistdev/alfajor.git $ cd alfajor $ python setup.py develop $ nosetests $ nosetests --browser=firefox $ nosetests --browser=googlechrome # fixed (mostly)
...now what?

import alfajor.browsers.selenium as alfs browser = alfs.Selenium('http://127.0.0.1:4444/', '*googlechrome', 'http://localhost:5000/') browser.open('/') # hooray!
  • browser has some methods like browser.open(), see alfajor.browser.zero for interface.
  • browser.document is your lxml view. It has magic alfajor frosting, see alfajor._lxml.DOMElement for the things you can do.
  • domelement[selector] is how you get elements.
  • browser.wait_for() takes some different sorts of things, see Selenium.wait_for. Note that you may be writing selenium locators here, not cssselectors as accepted by browser.document[].
  • browser doesn't have any direct interface to selenium.get_eval, but if you don't mind breaking the abstraction you can get to it through browser.selenium.get_eval.

testing, alfajor, python

Previous post Next post
Up