semperos/clj-webdriver — Issue #38: Support for WebDriver actions
Author: locopati
Created: 2012-02-06 16:59:41+00:00
State: open

WebDriver has an [actions API](http://selenium.googlecode.com/svn/trunk/docs/api/java/org/openqa/selenium/interactions/Actions.html)

Here's [an example](https://groups.google.com/forum/#!topic/selenium-users/oxmxWe-Roro)

```java
WebElement myElement =driver.findElement(By.xpath("//foo"));
Actions builder = new Actions(driver);
builder.moveToElement(myElement).build().perform();
```

You can do this with clj-webdriver but you're falling back to the underlying java and leaking an understanding of the clj-webdriver types (by accessing the webdriver and webelement directly).

```clojure
(def act (Actions. (:webdriver b)))
(.. act (moveToElement (:webelement e)) build perform)
```

Here's an example of why one might need this...need to hover over an element and verify that the css has changed (either through a class change or through deeper digging into the brower's computed style, if that's even possible, haven't got there yet).