I'm following this example in terms of adding a cursor to the captured video when running my test:
Visualize / Show mouse cursor position in selenium 2 tests (for example PHPUnit Webdriver)
I've noticed, in the captured video, only form buttons will display the cursor. If the test clicks on any other id (ex. div, a), the cursor doesn't show.
Here's my custom click()
method:
<?php
protected function click($id)
{
//unfortunately, element wait is outside of this function, assume id present ATM
$this->driver->executeScript("enableCursor();");
$action = new WebDriverActions($this->driver);
$el = $this->findById($id);
$action->moveToElement($el);
//wait, in seconds, before clicking - maybe what's missing to display the cursor?
$this->driver->manage()->timeouts()->implicitlyWait(2);
$action->click()->perform();
}
// find element with ID specified
protected function findById($id)
{
return $this->driver->findElement(WebDriverBy::id($id));
}
Update #1
Getting a bit more visuals this way, than with the cursor. However, some clicks are missing.
$css = "document.getElementById('".$id."').style = 'border: 2px solid red;';";
$this->driver->executeScript($css);