Omaha Python Users Group

Python Users in the Omaha Metro Area

November 22, 2011

Omaha Python Users Group Meeting, Nov 21, 2011

Filed under: code,MeetingNotes,Snippets — JeffH @ 9:56 am

Tonight’s Meeting Topics:

-- Selenium2 --

Selenium RC vs Webdriver -
Selenium - http://seleniumhq.org/
         - http://seleniumhq.org/docs/03_webdriver.html
Why - http://seleniumhq.org/docs/appendix_migrating_from_rc_to_webdriver.html

Firefox, Chrome, Ie, iOS, Android, Opera

-- Setting up an environment --
  virtualenv --no-site-packages Se-Pres(entation)
  cd Se-Pres
  source bin/activate
  easy_install selenium
Now fire up an interpreter:
  python
  from selenium import webdriver
  b = webdriver.Firefox()
  b.get('http://www.google.com/')
  b.page_source
  dir(b)
  b.name
  b.get_cookies()   (a list of dicts, each containing a cookie and support info)
  b.current_url

>>> b.find_element_by_name('q')
<selenium.webdriver.remote.webelement.WebElement object at 0x874b22c>
>>> sbx = b.find_element_by_name('q')
>>> sbx.send_keys('omaha python')
>>> sbx.submit()
>>> b.title
u'omaha python - Google Search'

  b.find_element_by_name('foo')
selenium.common.exceptions.NoSuchElementException

-- Other Helpful things --
unittest - http://docs.python.org/library/unittest.html#
nose - http://readthedocs.org/docs/nose/en/latest/

nose-testconfig - http://pypi.python.org/pypi/nose-testconfig/

The meeting concluded about 9pm when the venue closed but we continued with a 15 minute parking lot track that included references to Code Complete and general development concepts.  Great Meeting! and everyone is looking forward to the next.

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress

Stop SOPA