Yes, yet another Selenium Web Driver library has been brought to the table. This one, however, is slightly different.
- Easy to understand.
- Full test coverage by unit tests and integration tests.
- Excellent support; we use this in our main project so if you find an issue - it'll likely impact us!
- Idiomatic, structured code with no gimmicks.
- Simple errors that describe what has happened and why.
As with all Go libraries, go-selenium is easy to install. Simply run the below command:
go get github.com/bunsenapp/go-selenium
and then import the library in your project:
import "github.com/bunsenapp/go-selenium"
Prior to using this library you need to ensure that you have a Selenium instance running (standalone or grid is fine). If you don't know how to do this, there is a small section called 'Getting Selenium running' below.
Please see the examples/getting-started/main.go file.
Further examples, including tests of HackerNews (c), are available within the examples
directory.
All documentation is available on the godoc.org website: https://godoc.org/github.com/bunsenapp/go-selenium.
- Choose an image from the following URL: https://github.com/SeleniumHQ/docker-selenium
- Execute the following Docker command replacing the image with your chosen one:
docker run -d -p 4444:4444 --name selenium selenium/standalone-firefox
.
- Download the Selenium standalone server from the following URL: http://www.seleniumhq.org/download/
- Download the appropriate web driver executable and include it in your path. For Firefox, that will be the Gecko driver.
- Run the Selenium server with the following command:
java -jar selenium-server-standalone-3.0.1.jar
.
This project is currently in an alpha state. This means it is fairly new and hasn't been used all that much in the big wide world. Fortunately, this doesn't mean it's not stable. The project been developed in such a way that any changes will not leave you having to re-write your code.