I need close and open new browser in protractor The 2019 Stack Overflow Developer Survey Results Are InWhy don't self-closing script elements work?What is the 'new' keyword in JavaScript?Get the size of the screen, current web page and browser windowOpen a URL in a new tab (and not a new window) using JavaScriptHow can I add new array elements at the beginning of an array in Javascript?Protractor: Open new webdriver after every describe?How to restart protractor instance with a new session?How can we use protractor beforeAll and afterAll hooks for opening and closing a browser in each describe blockProtractor test fails on CIJasmine - Restart browser between tests (it blocks)

Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?

If climate change impact can be observed in nature, has that had any effect on rural, i.e. farming community, perception of the scientific consensus?

Short story: man watches girlfriend's spaceship entering a 'black hole' (?) forever

Why couldn't they take pictures of a closer black hole?

Can a flute soloist sit?

Match Roman Numerals

What does もの mean in this sentence?

Why can I use a list index as an indexing variable in a for loop?

Loose spokes after only a few rides

Why don't hard Brexiteers insist on a hard border to prevent illegal immigration after Brexit?

What is preventing me from simply constructing a hash that's lower than the current target?

Can withdrawing asylum be illegal?

If my opponent casts Ultimate Price on my Phantasmal Bear, can I save it by casting Snap or Curfew?

Geography at the pixel level

Keeping a retro style to sci-fi spaceships?

What must someone know in statistics and machine learning?

Finding the area between two curves with Integrate

Getting crown tickets for Statue of Liberty

What could be the right powersource for 15 seconds lifespan disposable giant chainsaw?

How much of the clove should I use when using big garlic heads?

Deal with toxic manager when you can't quit

Why doesn't shell automatically fix "useless use of cat"?

Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?

Why isn't the circumferential light around the M87 black hole's event horizon symmetric?



I need close and open new browser in protractor



The 2019 Stack Overflow Developer Survey Results Are InWhy don't self-closing script elements work?What is the 'new' keyword in JavaScript?Get the size of the screen, current web page and browser windowOpen a URL in a new tab (and not a new window) using JavaScriptHow can I add new array elements at the beginning of an array in Javascript?Protractor: Open new webdriver after every describe?How to restart protractor instance with a new session?How can we use protractor beforeAll and afterAll hooks for opening and closing a browser in each describe blockProtractor test fails on CIJasmine - Restart browser between tests (it blocks)



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I have a simple test:



beforeEach(function () 
lib.startApp(constants.ENVIRONMENT, browser);//get url
loginPageLoc.loginAs(constants.ADMIN_LOGIN,constants.ADMIN_PASSWORD,
browser);// log in
browser.driver.sleep(5000); //wait
);

afterEach(function()
browser.restart(); //or browser.close()
);

it('Test1' , async() =>
lib.waitUntilClickable(adminManagersPage.ButtonManagers, browser);
adminManagersPage.ButtonManagers.click();
expect(element(by.css('.common-popup')).isPresent()).toBe(false);
);
it('Test2' , async() =>
lib.waitUntilClickable(adminManagersPage.ButtonManagers, browser);
adminManagersPage.ButtonManagers.click();
expect(element(by.css('.common-popup')).isPresent()).toBe(false);
);


The first iteration looks fine, but after .restart() I get:




Failed: This driver instance does not have a valid session ID (did you
call WebDriver.quit()?) and may no longer be used. NoSuchSessionError:
This driver instance does not have a valid session ID (did you call
WebDriver.quit()?) and may no longer be used.




If I use .close() I get:




Failed: invalid session id




But if I change Test2 on simple console.log('case 1'); it looks fine.



Please explain what am I doing wrong?










share|improve this question






























    0















    I have a simple test:



    beforeEach(function () 
    lib.startApp(constants.ENVIRONMENT, browser);//get url
    loginPageLoc.loginAs(constants.ADMIN_LOGIN,constants.ADMIN_PASSWORD,
    browser);// log in
    browser.driver.sleep(5000); //wait
    );

    afterEach(function()
    browser.restart(); //or browser.close()
    );

    it('Test1' , async() =>
    lib.waitUntilClickable(adminManagersPage.ButtonManagers, browser);
    adminManagersPage.ButtonManagers.click();
    expect(element(by.css('.common-popup')).isPresent()).toBe(false);
    );
    it('Test2' , async() =>
    lib.waitUntilClickable(adminManagersPage.ButtonManagers, browser);
    adminManagersPage.ButtonManagers.click();
    expect(element(by.css('.common-popup')).isPresent()).toBe(false);
    );


    The first iteration looks fine, but after .restart() I get:




    Failed: This driver instance does not have a valid session ID (did you
    call WebDriver.quit()?) and may no longer be used. NoSuchSessionError:
    This driver instance does not have a valid session ID (did you call
    WebDriver.quit()?) and may no longer be used.




    If I use .close() I get:




    Failed: invalid session id




    But if I change Test2 on simple console.log('case 1'); it looks fine.



    Please explain what am I doing wrong?










    share|improve this question


























      0












      0








      0








      I have a simple test:



      beforeEach(function () 
      lib.startApp(constants.ENVIRONMENT, browser);//get url
      loginPageLoc.loginAs(constants.ADMIN_LOGIN,constants.ADMIN_PASSWORD,
      browser);// log in
      browser.driver.sleep(5000); //wait
      );

      afterEach(function()
      browser.restart(); //or browser.close()
      );

      it('Test1' , async() =>
      lib.waitUntilClickable(adminManagersPage.ButtonManagers, browser);
      adminManagersPage.ButtonManagers.click();
      expect(element(by.css('.common-popup')).isPresent()).toBe(false);
      );
      it('Test2' , async() =>
      lib.waitUntilClickable(adminManagersPage.ButtonManagers, browser);
      adminManagersPage.ButtonManagers.click();
      expect(element(by.css('.common-popup')).isPresent()).toBe(false);
      );


      The first iteration looks fine, but after .restart() I get:




      Failed: This driver instance does not have a valid session ID (did you
      call WebDriver.quit()?) and may no longer be used. NoSuchSessionError:
      This driver instance does not have a valid session ID (did you call
      WebDriver.quit()?) and may no longer be used.




      If I use .close() I get:




      Failed: invalid session id




      But if I change Test2 on simple console.log('case 1'); it looks fine.



      Please explain what am I doing wrong?










      share|improve this question
















      I have a simple test:



      beforeEach(function () 
      lib.startApp(constants.ENVIRONMENT, browser);//get url
      loginPageLoc.loginAs(constants.ADMIN_LOGIN,constants.ADMIN_PASSWORD,
      browser);// log in
      browser.driver.sleep(5000); //wait
      );

      afterEach(function()
      browser.restart(); //or browser.close()
      );

      it('Test1' , async() =>
      lib.waitUntilClickable(adminManagersPage.ButtonManagers, browser);
      adminManagersPage.ButtonManagers.click();
      expect(element(by.css('.common-popup')).isPresent()).toBe(false);
      );
      it('Test2' , async() =>
      lib.waitUntilClickable(adminManagersPage.ButtonManagers, browser);
      adminManagersPage.ButtonManagers.click();
      expect(element(by.css('.common-popup')).isPresent()).toBe(false);
      );


      The first iteration looks fine, but after .restart() I get:




      Failed: This driver instance does not have a valid session ID (did you
      call WebDriver.quit()?) and may no longer be used. NoSuchSessionError:
      This driver instance does not have a valid session ID (did you call
      WebDriver.quit()?) and may no longer be used.




      If I use .close() I get:




      Failed: invalid session id




      But if I change Test2 on simple console.log('case 1'); it looks fine.



      Please explain what am I doing wrong?







      javascript protractor






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 7 at 21:59









      Cindy Meister

      16.1k102537




      16.1k102537










      asked Mar 7 at 21:15









      Artem KrynychyiArtem Krynychyi

      52




      52






















          2 Answers
          2






          active

          oldest

          votes


















          1














          You are declaring your functions as async but are not awaiting the any actions within. If you are not setting your SELENIUM_PROMISE_MANAGER to false in your config then you will see unexpected behavior throughout your test when declaring async functions. This async behavior is likely the cause of your issue so I would ensure SELENIUM_PROMISE_MANAGER:false and ensure your awaiting your actions in each function.



          The reason your test passes if you change the second test to just be console.log() is because you are not interacting with the browser and therefore the selenium session ID is not required. Every time the browser is closed the selenium session id will be destroyed and a new one created when a new browser window is launched.



          Also you should be aware that there is a config setting you can enable so you do not need to do it manually in your test.



          Update: Adding code examples of what I have described:



          Note: If you have a lot of code already developed it will take serious effort to convert your framework to Async/await syntax. For a quicker solution you could try removing the async keywords from your it blocks



          Add these to your config



          SELENIUM_PROMISE_MANAGER:false,
          restartBrowserBetweenTests:true


          and change you spec to



          beforeEach(async function () 
          await lib.startApp(constants.ENVIRONMENT, browser);//get url
          await loginPageLoc.loginAs(constants.ADMIN_LOGIN, constants.ADMIN_PASSWORD,
          browser);// log in
          await browser.driver.sleep(5000); //wait
          );

          it('Test1', async () =>
          await lib.waitUntilClickable(adminManagersPage.ButtonManagers, browser);
          await adminManagersPage.ButtonManagers.click();
          expect(await element(by.css('.common-popup')).isPresent()).toBe(false);
          );
          it('Test2', async () =>
          await lib.waitUntilClickable(adminManagersPage.ButtonManagers, browser);
          await adminManagersPage.ButtonManagers.click();
          expect(await element(by.css('.common-popup')).isPresent()).toBe(false);
          );





          share|improve this answer

























          • thanks for explanation! I've done as you adviced, but now i get error: UnhandledPromiseRejectionWarning: NoSuchElementError: No element found using locator: By(css selector, [type=email]).

            – Artem Krynychyi
            Mar 10 at 20:31












          • @ArtemKrynychyi Are you sure that locator is correct? You appear to be missing the quotes around the 'email'?

            – DublinDev
            Mar 10 at 20:33











          • yes, because when i start old version of test, it looks well

            – Artem Krynychyi
            Mar 10 at 20:39











          • @Artem Is there any chance your script is failing before that element interaction by your script the original way? Could you try adding some quotes around the email part of that locator, I can't see how that locator would work without the quotes but could be mistaken

            – DublinDev
            Mar 10 at 20:57






          • 1





            I've figured out why it hasn't worked before. I used function LoginAs which wasn't async. Now i've fixed that and it looks well. Thanks for help!!!

            – Artem Krynychyi
            Mar 11 at 9:24



















          0














          There is a relevant configuration option:



          // If true, protractor will restart the browser between each test.



          restartBrowserBetweenTests: true,


          Add the above in your config to restart browser between your tests.



          Hope it helps you.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55052907%2fi-need-close-and-open-new-browser-in-protractor%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            You are declaring your functions as async but are not awaiting the any actions within. If you are not setting your SELENIUM_PROMISE_MANAGER to false in your config then you will see unexpected behavior throughout your test when declaring async functions. This async behavior is likely the cause of your issue so I would ensure SELENIUM_PROMISE_MANAGER:false and ensure your awaiting your actions in each function.



            The reason your test passes if you change the second test to just be console.log() is because you are not interacting with the browser and therefore the selenium session ID is not required. Every time the browser is closed the selenium session id will be destroyed and a new one created when a new browser window is launched.



            Also you should be aware that there is a config setting you can enable so you do not need to do it manually in your test.



            Update: Adding code examples of what I have described:



            Note: If you have a lot of code already developed it will take serious effort to convert your framework to Async/await syntax. For a quicker solution you could try removing the async keywords from your it blocks



            Add these to your config



            SELENIUM_PROMISE_MANAGER:false,
            restartBrowserBetweenTests:true


            and change you spec to



            beforeEach(async function () 
            await lib.startApp(constants.ENVIRONMENT, browser);//get url
            await loginPageLoc.loginAs(constants.ADMIN_LOGIN, constants.ADMIN_PASSWORD,
            browser);// log in
            await browser.driver.sleep(5000); //wait
            );

            it('Test1', async () =>
            await lib.waitUntilClickable(adminManagersPage.ButtonManagers, browser);
            await adminManagersPage.ButtonManagers.click();
            expect(await element(by.css('.common-popup')).isPresent()).toBe(false);
            );
            it('Test2', async () =>
            await lib.waitUntilClickable(adminManagersPage.ButtonManagers, browser);
            await adminManagersPage.ButtonManagers.click();
            expect(await element(by.css('.common-popup')).isPresent()).toBe(false);
            );





            share|improve this answer

























            • thanks for explanation! I've done as you adviced, but now i get error: UnhandledPromiseRejectionWarning: NoSuchElementError: No element found using locator: By(css selector, [type=email]).

              – Artem Krynychyi
              Mar 10 at 20:31












            • @ArtemKrynychyi Are you sure that locator is correct? You appear to be missing the quotes around the 'email'?

              – DublinDev
              Mar 10 at 20:33











            • yes, because when i start old version of test, it looks well

              – Artem Krynychyi
              Mar 10 at 20:39











            • @Artem Is there any chance your script is failing before that element interaction by your script the original way? Could you try adding some quotes around the email part of that locator, I can't see how that locator would work without the quotes but could be mistaken

              – DublinDev
              Mar 10 at 20:57






            • 1





              I've figured out why it hasn't worked before. I used function LoginAs which wasn't async. Now i've fixed that and it looks well. Thanks for help!!!

              – Artem Krynychyi
              Mar 11 at 9:24
















            1














            You are declaring your functions as async but are not awaiting the any actions within. If you are not setting your SELENIUM_PROMISE_MANAGER to false in your config then you will see unexpected behavior throughout your test when declaring async functions. This async behavior is likely the cause of your issue so I would ensure SELENIUM_PROMISE_MANAGER:false and ensure your awaiting your actions in each function.



            The reason your test passes if you change the second test to just be console.log() is because you are not interacting with the browser and therefore the selenium session ID is not required. Every time the browser is closed the selenium session id will be destroyed and a new one created when a new browser window is launched.



            Also you should be aware that there is a config setting you can enable so you do not need to do it manually in your test.



            Update: Adding code examples of what I have described:



            Note: If you have a lot of code already developed it will take serious effort to convert your framework to Async/await syntax. For a quicker solution you could try removing the async keywords from your it blocks



            Add these to your config



            SELENIUM_PROMISE_MANAGER:false,
            restartBrowserBetweenTests:true


            and change you spec to



            beforeEach(async function () 
            await lib.startApp(constants.ENVIRONMENT, browser);//get url
            await loginPageLoc.loginAs(constants.ADMIN_LOGIN, constants.ADMIN_PASSWORD,
            browser);// log in
            await browser.driver.sleep(5000); //wait
            );

            it('Test1', async () =>
            await lib.waitUntilClickable(adminManagersPage.ButtonManagers, browser);
            await adminManagersPage.ButtonManagers.click();
            expect(await element(by.css('.common-popup')).isPresent()).toBe(false);
            );
            it('Test2', async () =>
            await lib.waitUntilClickable(adminManagersPage.ButtonManagers, browser);
            await adminManagersPage.ButtonManagers.click();
            expect(await element(by.css('.common-popup')).isPresent()).toBe(false);
            );





            share|improve this answer

























            • thanks for explanation! I've done as you adviced, but now i get error: UnhandledPromiseRejectionWarning: NoSuchElementError: No element found using locator: By(css selector, [type=email]).

              – Artem Krynychyi
              Mar 10 at 20:31












            • @ArtemKrynychyi Are you sure that locator is correct? You appear to be missing the quotes around the 'email'?

              – DublinDev
              Mar 10 at 20:33











            • yes, because when i start old version of test, it looks well

              – Artem Krynychyi
              Mar 10 at 20:39











            • @Artem Is there any chance your script is failing before that element interaction by your script the original way? Could you try adding some quotes around the email part of that locator, I can't see how that locator would work without the quotes but could be mistaken

              – DublinDev
              Mar 10 at 20:57






            • 1





              I've figured out why it hasn't worked before. I used function LoginAs which wasn't async. Now i've fixed that and it looks well. Thanks for help!!!

              – Artem Krynychyi
              Mar 11 at 9:24














            1












            1








            1







            You are declaring your functions as async but are not awaiting the any actions within. If you are not setting your SELENIUM_PROMISE_MANAGER to false in your config then you will see unexpected behavior throughout your test when declaring async functions. This async behavior is likely the cause of your issue so I would ensure SELENIUM_PROMISE_MANAGER:false and ensure your awaiting your actions in each function.



            The reason your test passes if you change the second test to just be console.log() is because you are not interacting with the browser and therefore the selenium session ID is not required. Every time the browser is closed the selenium session id will be destroyed and a new one created when a new browser window is launched.



            Also you should be aware that there is a config setting you can enable so you do not need to do it manually in your test.



            Update: Adding code examples of what I have described:



            Note: If you have a lot of code already developed it will take serious effort to convert your framework to Async/await syntax. For a quicker solution you could try removing the async keywords from your it blocks



            Add these to your config



            SELENIUM_PROMISE_MANAGER:false,
            restartBrowserBetweenTests:true


            and change you spec to



            beforeEach(async function () 
            await lib.startApp(constants.ENVIRONMENT, browser);//get url
            await loginPageLoc.loginAs(constants.ADMIN_LOGIN, constants.ADMIN_PASSWORD,
            browser);// log in
            await browser.driver.sleep(5000); //wait
            );

            it('Test1', async () =>
            await lib.waitUntilClickable(adminManagersPage.ButtonManagers, browser);
            await adminManagersPage.ButtonManagers.click();
            expect(await element(by.css('.common-popup')).isPresent()).toBe(false);
            );
            it('Test2', async () =>
            await lib.waitUntilClickable(adminManagersPage.ButtonManagers, browser);
            await adminManagersPage.ButtonManagers.click();
            expect(await element(by.css('.common-popup')).isPresent()).toBe(false);
            );





            share|improve this answer















            You are declaring your functions as async but are not awaiting the any actions within. If you are not setting your SELENIUM_PROMISE_MANAGER to false in your config then you will see unexpected behavior throughout your test when declaring async functions. This async behavior is likely the cause of your issue so I would ensure SELENIUM_PROMISE_MANAGER:false and ensure your awaiting your actions in each function.



            The reason your test passes if you change the second test to just be console.log() is because you are not interacting with the browser and therefore the selenium session ID is not required. Every time the browser is closed the selenium session id will be destroyed and a new one created when a new browser window is launched.



            Also you should be aware that there is a config setting you can enable so you do not need to do it manually in your test.



            Update: Adding code examples of what I have described:



            Note: If you have a lot of code already developed it will take serious effort to convert your framework to Async/await syntax. For a quicker solution you could try removing the async keywords from your it blocks



            Add these to your config



            SELENIUM_PROMISE_MANAGER:false,
            restartBrowserBetweenTests:true


            and change you spec to



            beforeEach(async function () 
            await lib.startApp(constants.ENVIRONMENT, browser);//get url
            await loginPageLoc.loginAs(constants.ADMIN_LOGIN, constants.ADMIN_PASSWORD,
            browser);// log in
            await browser.driver.sleep(5000); //wait
            );

            it('Test1', async () =>
            await lib.waitUntilClickable(adminManagersPage.ButtonManagers, browser);
            await adminManagersPage.ButtonManagers.click();
            expect(await element(by.css('.common-popup')).isPresent()).toBe(false);
            );
            it('Test2', async () =>
            await lib.waitUntilClickable(adminManagersPage.ButtonManagers, browser);
            await adminManagersPage.ButtonManagers.click();
            expect(await element(by.css('.common-popup')).isPresent()).toBe(false);
            );






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 8 at 11:13

























            answered Mar 7 at 21:47









            DublinDevDublinDev

            1,1521320




            1,1521320












            • thanks for explanation! I've done as you adviced, but now i get error: UnhandledPromiseRejectionWarning: NoSuchElementError: No element found using locator: By(css selector, [type=email]).

              – Artem Krynychyi
              Mar 10 at 20:31












            • @ArtemKrynychyi Are you sure that locator is correct? You appear to be missing the quotes around the 'email'?

              – DublinDev
              Mar 10 at 20:33











            • yes, because when i start old version of test, it looks well

              – Artem Krynychyi
              Mar 10 at 20:39











            • @Artem Is there any chance your script is failing before that element interaction by your script the original way? Could you try adding some quotes around the email part of that locator, I can't see how that locator would work without the quotes but could be mistaken

              – DublinDev
              Mar 10 at 20:57






            • 1





              I've figured out why it hasn't worked before. I used function LoginAs which wasn't async. Now i've fixed that and it looks well. Thanks for help!!!

              – Artem Krynychyi
              Mar 11 at 9:24


















            • thanks for explanation! I've done as you adviced, but now i get error: UnhandledPromiseRejectionWarning: NoSuchElementError: No element found using locator: By(css selector, [type=email]).

              – Artem Krynychyi
              Mar 10 at 20:31












            • @ArtemKrynychyi Are you sure that locator is correct? You appear to be missing the quotes around the 'email'?

              – DublinDev
              Mar 10 at 20:33











            • yes, because when i start old version of test, it looks well

              – Artem Krynychyi
              Mar 10 at 20:39











            • @Artem Is there any chance your script is failing before that element interaction by your script the original way? Could you try adding some quotes around the email part of that locator, I can't see how that locator would work without the quotes but could be mistaken

              – DublinDev
              Mar 10 at 20:57






            • 1





              I've figured out why it hasn't worked before. I used function LoginAs which wasn't async. Now i've fixed that and it looks well. Thanks for help!!!

              – Artem Krynychyi
              Mar 11 at 9:24

















            thanks for explanation! I've done as you adviced, but now i get error: UnhandledPromiseRejectionWarning: NoSuchElementError: No element found using locator: By(css selector, [type=email]).

            – Artem Krynychyi
            Mar 10 at 20:31






            thanks for explanation! I've done as you adviced, but now i get error: UnhandledPromiseRejectionWarning: NoSuchElementError: No element found using locator: By(css selector, [type=email]).

            – Artem Krynychyi
            Mar 10 at 20:31














            @ArtemKrynychyi Are you sure that locator is correct? You appear to be missing the quotes around the 'email'?

            – DublinDev
            Mar 10 at 20:33





            @ArtemKrynychyi Are you sure that locator is correct? You appear to be missing the quotes around the 'email'?

            – DublinDev
            Mar 10 at 20:33













            yes, because when i start old version of test, it looks well

            – Artem Krynychyi
            Mar 10 at 20:39





            yes, because when i start old version of test, it looks well

            – Artem Krynychyi
            Mar 10 at 20:39













            @Artem Is there any chance your script is failing before that element interaction by your script the original way? Could you try adding some quotes around the email part of that locator, I can't see how that locator would work without the quotes but could be mistaken

            – DublinDev
            Mar 10 at 20:57





            @Artem Is there any chance your script is failing before that element interaction by your script the original way? Could you try adding some quotes around the email part of that locator, I can't see how that locator would work without the quotes but could be mistaken

            – DublinDev
            Mar 10 at 20:57




            1




            1





            I've figured out why it hasn't worked before. I used function LoginAs which wasn't async. Now i've fixed that and it looks well. Thanks for help!!!

            – Artem Krynychyi
            Mar 11 at 9:24






            I've figured out why it hasn't worked before. I used function LoginAs which wasn't async. Now i've fixed that and it looks well. Thanks for help!!!

            – Artem Krynychyi
            Mar 11 at 9:24














            0














            There is a relevant configuration option:



            // If true, protractor will restart the browser between each test.



            restartBrowserBetweenTests: true,


            Add the above in your config to restart browser between your tests.



            Hope it helps you.






            share|improve this answer



























              0














              There is a relevant configuration option:



              // If true, protractor will restart the browser between each test.



              restartBrowserBetweenTests: true,


              Add the above in your config to restart browser between your tests.



              Hope it helps you.






              share|improve this answer

























                0












                0








                0







                There is a relevant configuration option:



                // If true, protractor will restart the browser between each test.



                restartBrowserBetweenTests: true,


                Add the above in your config to restart browser between your tests.



                Hope it helps you.






                share|improve this answer













                There is a relevant configuration option:



                // If true, protractor will restart the browser between each test.



                restartBrowserBetweenTests: true,


                Add the above in your config to restart browser between your tests.



                Hope it helps you.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 8 at 6:43









                MadhanMadhan

                6471111




                6471111



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55052907%2fi-need-close-and-open-new-browser-in-protractor%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    1928 у кіно

                    Захаров Федір Захарович

                    Ель Греко