I have one test case contains two methods. When trying the two test methods in two browser instance, only one browser instance can open the website but the rest of the steps can't execute. Another browser instance can't even open the website (blank page).
I've tried the suggested solution on Stackoverflow. Those solutions do not work in my case.
public class RunSimpleTest{ private String baseUrl = "https://mywebsite"; public WebDriver driver; GlobalFunctions objGlobalFunc; @BeforeMethod(alwaysRun = true) public void setup() { try{ // declaration and instantiation of objects/variables System.setProperty("webdriver.chrome.driver", "C:/ChromeDriver/chromedriver.exe"); // Disable Chrome Developer Mode Extension ChromeOptions options = new ChromeOptions(); options.addArguments("--disable-extensions"); options.addArguments("--start-maximized"); driver = new ChromeDriver(options); driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); objGlobalFunc = new GlobalFunctions(driver); driver.get(baseUrl); objGlobalFunc = new GlobalFunctions(driver); objGlobalFunc.selectEnglishLanguage(); } catch (Exception e){ e.printStackTrace(); } } @Test public void BTRun1() { objGlobalFunc.setUserNameValue("ABC"); objGlobalFunc.clickOKBtnOnMEXLoginForm(); } @Test public void BTRun2() { objGlobalFunc.setUserNameValue("ABC"); objGlobalFunc.clickOKBtnOnMEXLoginForm(); } } BTRun1 is opened in a chrome browser. And, the user can login.
BTRun2 is opened in another chrome browser. And, the user can login.