下面列出的代碼應該在第二個@Test
塊中登錄,它會從創建的登錄文件中選取它。我擴展了「Testbase」類。它正在記錄正常,但第二個代碼無法從中讀取,並且它再次執行相同的功能,因此它會打開兩次Web瀏覽器。請高度讚賞任何建議。謝謝在我的測試套件中使用一次性登錄testNg
public class Case_Trackin extends TestBase{
public WebDriver driver;
@Test
public void OpeningBrowser() throws IOException InterruptedException
{
Login();
}
@Test (dependsOnMethods="OpeningBrowser", alwaysRun=true) //This block of code previews the ExcelSpreadsheet file
{
}
@AfterMethod public void tearDown()
{
//driver.quit();
}
}