java
html
php
c
xml
ajax
python
linux
android
regex
mysql
flash
json
algorithm
cocoa
tsql
mvc
php5
asp
dom
You can pass in any Xpath to target the desired element.
$this->assertElementContainsText( "//p[@id='foo']/a[@href='http://www.example.com/']", 'bar' );
You can add the following to your base class to allow testing for exact matches on the contents.
/** * Asserts that an element contains exactly a given string. * * @param string $locator * @param string $text * @param string $message */ public function assertElementTextEquals($locator, $text, $message = '') { $this->assertEquals($text, $this->getText($locator), $message); }