Skip to main content

I have create testcasescreated some test cases in eclipseEclipse.but But while runnigrunning the testng.xml file it's openit opens in a new browser every time.how to How do I run it in single browser.i? I am calling below for every testcaseseach test case, so it's openit opens in a new browser each time.

@BeforeClass
    public static void setup()
    {
        
        
        System.setProperty("webdriver.chrome.driver", "E:\\Selenium Jar\\chromedriver.exe");
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--disable-extensions");
        driver = new ChromeDriver(options);
        driver.manage().window().maximize();
             
    }

I have create testcases in eclipse.but while runnig testng.xml file it's open in new browser every time.how to run it in single browser.i am calling below for every testcases so it's open in new browser.

@BeforeClass
    public static void setup()
    {
        
        
        System.setProperty("webdriver.chrome.driver", "E:\\Selenium Jar\\chromedriver.exe");
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--disable-extensions");
        driver = new ChromeDriver(options);
        driver.manage().window().maximize();
         
    }

I have created some test cases in Eclipse. But while running the testng.xml file it opens in a new browser every time. How do I run it in single browser? I am calling below for each test case, so it opens in a new browser each time.

@BeforeClass
    public static void setup()
    {           
        System.setProperty("webdriver.chrome.driver", "E:\\Selenium Jar\\chromedriver.exe");
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--disable-extensions");
        driver = new ChromeDriver(options);
        driver.manage().window().maximize();            
    }
edited tags
Source Link
Rutvi Soni
  • 536
  • 1
  • 11
  • 27

I have create testcases for the different different pagesin eclipse.but while runnig thattestng.xml file it's open in new browser every time.how to run it in single browser.i am calling below for every testcases so it's open in new browser.

@BeforeClass
    public static void setup()
    {
        
        
        System.setProperty("webdriver.chrome.driver", "E:\\Selenium Jar\\chromedriver.exe");
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--disable-extensions");
        driver = new ChromeDriver(options);
        driver.manage().window().maximize();
        
    }

I have create testcases for the different different pages.but while runnig that file it's open in new browser every time.how to run it in single browser.i am calling below for every testcases so it's open in new browser.

@BeforeClass
    public static void setup()
    {
        
        
        System.setProperty("webdriver.chrome.driver", "E:\\Selenium Jar\\chromedriver.exe");
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--disable-extensions");
        driver = new ChromeDriver(options);
        driver.manage().window().maximize();
        
    }

I have create testcases in eclipse.but while runnig testng.xml file it's open in new browser every time.how to run it in single browser.i am calling below for every testcases so it's open in new browser.

@BeforeClass
    public static void setup()
    {
        
        
        System.setProperty("webdriver.chrome.driver", "E:\\Selenium Jar\\chromedriver.exe");
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--disable-extensions");
        driver = new ChromeDriver(options);
        driver.manage().window().maximize();
        
    }
Source Link
Rutvi Soni
  • 536
  • 1
  • 11
  • 27

How to run testcases on one browser

I have create testcases for the different different pages.but while runnig that file it's open in new browser every time.how to run it in single browser.i am calling below for every testcases so it's open in new browser.

@BeforeClass
    public static void setup()
    {
        
        
        System.setProperty("webdriver.chrome.driver", "E:\\Selenium Jar\\chromedriver.exe");
        ChromeOptions options = new ChromeOptions();
        options.addArguments("--disable-extensions");
        driver = new ChromeDriver(options);
        driver.manage().window().maximize();
        
    }