java - Using regexp in assertEquals() does not work -
i'm having problems using regexp in assertequals() statement. statement.
assert.assertequals("regexp:*tst-*[0-9]{5}", driver.gettitle());
but error:
org.junit.comparisonfailure: expected:<[regexp:*tst-*[0-9]{5}]> was:<[[#tst-23570] new summary]>
it looks regexp string being compared. missing?
it doesn't you're using regex. seems maybe you're trying do?
assert.asserttrue(driver.gettitle().matches("*tst-*[0-9]{5}"));
edit #1:
it seems regex might not quite right, try:
assert.asserttrue(driver.gettitle().matches(".*tst-\\d{5}.*"));
Comments
Post a Comment