I’m not sure how you tested your sessions issue but having two webdrivers in parallel is a normal case and there should not be issues with cookies or whatever. Below is my test written in Java but you can easily implement it in C#:

public static void main(String[] args) {
    System.setProperty("webdriver..driver", "E:/Dev/WebDrivers/.exe");
    WebDriver driver1 = new ();
    WebDriver driver2 = new ();
    driver1.get("https://www.amazon.com/ref=nav_logo");
    driver2.get("https://www.amazon.com/ref=nav_logo");
    System.out.println("Driver1 cookies: " + driver1.manage().getCookies());
    System.out.println("Driver2 cookies: " + driver2.manage().getCookies());
    driver1.quit();
    driver2.quit();
}

So here you create two of WebDriver and each one will be operating with its own cookies set. I just checked that with amazon website since it uses sessions to track what you’re doing on the site even if you’re not logged in. Below is the output:

enter image description here

With this approach each webdriver opens their own window (not a tab).



Source link https://sqa.stackexchange.com/questions/35542/can-i----chrome-instances-with--chromedriver

LEAVE A REPLY

Please enter your comment!
Please enter your name here