The issue lies in your @BeforeSuite setup. Since you're initializing the WebDriver at the suite level, the same driver instance is shared across all tests, causing conflicts in parallel execution.
To fix this, move the WebDriver initialization to @BeforeClass (or @BeforeMethod if you need a new browser instance per test). Here's the updated code:
public class BaseTest {
protected WebDriver driver;
@BeforeClass
public void setup() {
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
}
@AfterClass
public void tearDown() {
if (driver != null) {
driver.quit();
}
}
}