Clone this repo:

Branches

  1. 6f14c44 Merge pull request #2 from wirepair/master by Federico Sogaro · 2 years, 11 months ago master
  2. 4cabc8a fix FocusOnFrame and add FocusParentFrame by wirepair · 3 years ago
  3. 5d331fd README markdown by Federico Sogaro · 4 years, 4 months ago
  4. 0371efd readme updated by Federico Sogaro · 4 years, 4 months ago
  5. db7bd0f first commit by Federico Sogaro · 4 years, 4 months ago

webdriver

The package implements a WebDriver that communicate with a browser using the JSON Wire Protocol (See https://code.google.com/p/selenium/wiki/JsonWireProtocol). This is a pure go library and doesn't require a running Selenium driver. It currently supports Firefox (using the WebDriver extension) and Chrome (using the standalone server chromedriver). It should be fairly easy to add other browser that directly implement the wire protocol.

Version: 0.1
Tests are partial and have been run only on Linux (with firefox webdriver 2.32.0 and chromedriver 2.1).

Install:
$ go get github.com/fedesog/webdriver

Requires:

Example:

chromeDriver := webdriver.NewChromeDriver("/path/to/chromedriver")
err := chromeDriver.Start()
if err != nil {
	log.Println(err)
}
desired := webdriver.Capabilities{"Platform": "Linux"}
required := webdriver.Capabilities{}
session, err := chromeDriver.NewSession(desired, required)
if err != nil {
	log.Println(err)
}
err = session.Url("http://golang.org")
if err != nil {
	log.Println(err)
}
time.Sleep(10 * time.Second)
session.Delete()
chromeDriver.Stop()