我是自动化新手并试图自动化一个网站
我的网页模型看起来像这样
class A
{
@BeforeMethod:here I open the url: opens the HOMEPAGE
@Test:I automate some thing on HOMEPAGE,[Ex:click to go] to MENUPAGE
@Test:I automate something on MENUPAGE to go thirdlink
}
但在执行第二个@Test(MENUPAGE)之前,它会调用@BeforeMethod。那么有什么方法可以停止,所以我不想在每个测试用例上继续打开浏览器。
答案 0 :(得分:1)
如果您只想打开网页一次并继续测试,可以使用@BeforeTest和@Beforesuite
@BeforeSuite:在此套件中的所有测试运行之前,将运行带注释的方法。 @BeforeTest:在运行属于标记内部类的任何测试方法之前,将运行带注释的方法。