Hello All, This is the first release of Selenium 2 Python bindings. It contains the Selenium 1 Python bindings and a working Selenium 2 remote client. The plan in the future is to add Firefox, IE and Chrome "direct" bindings as well. Please note this is ALPHA quality code, so expect bugs (and report them at http://code.google.com/p/selenium/issues) Installing ========== pip install -U selenium Using ===== Server ------ You'll need the Selenium 2 server (Java). Download it from http://selenium.googlecode.com/files/selenium-server-standalone-2.0a4.jar The run the server with "java -jar selenium-server- standalone-2.0a4.jar" Example ------- from selenium.remote import connect from selenium import FIREFOX from selenium.common.exceptions import NoSuchElementException from time import sleep browser = connect(FIREFOX) # Get local session of firefox browser.get("http://www.yahoo.com") # Load page assert browser.get_title() == "Yahoo!" elem = browser.find_element_by_name("p") # Find the query box elem.send_keys("selenium\n") sleep(0.2) # Let the page load, will be added to the API try: browser.find_element_by_xpath("//a[contains(@href,'http:// seleniumhq.org')]") except NoSuchElementException: assert 0, "can't find seleniumhq" browser.close() Happy testing, -- Miki
participants (1)
-
Miki