运行 testng.xml 文件显示调用方法错误

Running testng.xml file shows Invoked Methods error

当我运行宁seleniumtestng.xml文件时,我得到驱动程序的空指针异常,如果我直接运行登录class它工作正常。此外,当我从 .xml 文件中删除组标签时,它是 运行ning .xml 但我想使用组。 下面是 texng.xml:

    <groups>
        <run>

            <include name="Deal"  />
        </run>
    </groups>


    <classes>


    <class name="jproject.Login" />

    </classes>
</test>

我的登录 class 是:

public class 登录扩展 BClass{

    @Test (priority=1, groups = { "Nat", "Deal" }) // (description="This TC will perform valid login")

            public void LoginPage() throws InterruptedException 
            {   



                //Waits.loader(driver);
                String expectedTitle = "Clearview | Dashboard";
                String actualTitle = driver.getTitle();
                Assert.assertEquals(actualTitle, expectedTitle);    

                Reporter.log("Application Logged in successfully | ");  


         }

}

在我的 Bclass 中,我正在初始化驱动程序并在 @BeforeSuite 注释下登录。

我通过将 BClass 中的 @BeforeSuite 替换为 @BeforeGroups 找到了解决方法 谢谢大家!