Protractor restartBrowserBetweenTests

Protractor restartBrowserBetweenTests make the browser to restart between the it blocks. In protractor, It blocks are nothing but tests. SO if we have a requirement to start the browser between each test then we can make use of the code.

For example, we can't inject the test name into the browser at start time because it's starting up while the previous test is active. I have performed my testing using below code, give a try if you have time.

Spec file
import { browser} from "protractor";
describe("restart browser between tests in Protractor", function(){

    it('test 1', function() {
        browser.ignoreSynchronization = true
    it('test 2', function() {
        browser.ignoreSynchronization = true

Conf file

exports.config = {
  chromeDriver: 'PATH/chromedriver.exe',
  seleniumServerJar: 'PATH/jars/selenium-server-standalone-3.11.0.jar',
  specs: ['PATH\JSFilesLocation\Spec\abc.js'],
  restartBrowserBetweenTests: true,
  capabilities: {
	  browserName: 'chrome'
About Author :

I am Pavankumar, Having 8.5 years of experience currently working in Video/Live Analytics project.

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions
  • Vital
    Thank you for detailed answer. How to restart browser for each spec