You can create a new test case or suit by extending WebDriverTestCase class. Now you can create test same as in TestNG. If you are new to TestNG, here is the documentation.

On extending WebDriverTestCase following object will be available to use in your test.


Get thread safe WebDriverTestBase Instance that provides webdriver object.


Provides a thread safe webdriver object same as getTestBase().getDriver().


Instance of ITestContext, test context which contains all the information for a given test run.


Instance of PropertyUtil, can be used to read property value from any of the properties file.


public class SampleTestSuite extends WebDriverTestCase {
    public void test1() {
        // QAFWebElement fname = getDriver().findElement("fname locator");
        QAFWebElement fname = new QAFExtendedWebElement("fname locator");
        fname.verifyText(StringMatcher.exactIgnoringCase("expected text"));

Using Test Page in Test case

public class SampleTestSuite extends WebDriverTestCase {
    public void test1() {
        MyTestPage page = new MyTestPage();
        page.getFname().verifyText("expected text");


Test can be grouped and can be configured to run specific group or for dependency.

Setting dependency

You can set method dependency as supported by TestNG.

Precondition and post condition

Use @before/afterTest annotation from TestNG. You can call getTestBase() to have test base object in such methods.