@@ 0,0 1,25 @@
+Selenium surfer
+===============
+
+A small selenium load testing tool.
+
+It opens n seleniun sessions and repeatadly load URLs from this session. The
+list of URLs to load are passed from stdin, and a CSV of the result gets written
+on stdout.
+
+Here's how you run it:
+
+ echo http://www.example.com/ | ./selenium-surfer 'http://my.selenium.server/wd/hub'
+
+You can load multiple URLs, the following example loads example.com 1000 times:
+
+ yes http://www.example.com/ | sed1000q | ./seleniun-surfer 'http://my.selenium.server/wd/hub'
+
+By default, selenium-surfer spawns 4 workers routines. To bump it use the
+`--workers` option.
+
+Dependencies
+------------
+
+- github.com/jessevdk/go-flags
+- github.com/tebeka/selenium
@@ 40,7 40,7 @@ func (c *Client) reset() {
}
}
-func (c *Client) Connect() selenium.WebDriver {
+func (c *Client) connect() selenium.WebDriver {
if c.driver == nil {
// Try to connect to the endpoint
for {
@@ 48,7 48,7 @@ func (c *Client) Connect() selenium.WebD
c.driver, err = selenium.NewRemote(c.Capabilities, c.URL)
if err != nil {
- logger.Println("Error connecting to WD", c.URL, err)
+ logger.Println("Error connecting to", c.URL, err)
time.Sleep(30 * time.Second)
} else {
logger.Println("Connected to", c.URL)
@@ 70,7 70,7 @@ func (c *Client) Get(url string) (durati
c.reset()
}
- var driver = c.Connect()
+ var driver = c.connect()
var start = time.Now()
err = driver.Get(url)