Perform the following steps for using regular expressions for test:
regexp-testng.xmlto the project with the following content:
<suite name="Regular Exp Suite" verbose="1"> <test name="Regular Exp Test"> <classes> <class name="test.regularexppackage.RegularExpClass"> <methods> <include name=".*Test.*" /> </methods> </class> </classes> </test> </suite>
testng XML suite is configured to consider only those test methods from a particular class whose name contains the word
Test in it. The regular expression is considered by use of
.* before and after the text.