2015-02-19

Codeception: XPath `...` is malformed!

Environment:

Codeception PHP Testing Framework v2.0.11
Powered by PHPUnit 4.4.5 by Sebastian Bergmann.

Symptom:

* I am on page "/"
* I click "Terms of Use"

  XPath `Terms of Use` is malformed!

Cause:

$I->click( "Terms of Use" );

Cure:

$I->click(['link' => "Terms of Use"]);

From the documentation:

http://codeception.com/docs/modules/WebDriver#click

// using strict locator
$I->click(['link' => 'Login']);