Search code examples
xpathphpunitdynamic-data

Xpath syntax showing an error


I'm trying to test dynamic id's with PHPUnit so i choose to use xpath to check if the element contains the id specified, but when ever i run my test it gives me the error that Invalid xpath.

My xpath code is as follows

$this->click("xpath=//div[@contains(@id,'ROOT')]")

What can i be doing wrong guys?

Thanks Donald


Solution

  • Try removing the @ that's just before contains.