why do i get kicked out of a logged in web session?Why does the cypress recording take too much time?laravel redirection error after session outUnable to create asp.net session on a cookieless web applicationWhy do I get long delays when using LDTP (Cobra/PyATOM)Redirecting to the root URL in servletLogin through a web gateway with Cypress is timing outHow to redirect to an external URL from an Angular2 route's canActivate in Chrome while maintaining Referrer?How to get the text input field value to a const and log that value in Cypress.ioDrop-down menu, redirect dynamically to a link based on choice. When submit button is pressedWhy is cypress timing out when evaluating this regex?How can I imitate a real buying session while using cypress?

Were days ever written as ordinal numbers when writing day-month-year?

Why were 5.25" floppy drives cheaper than 8"?

Blending or harmonizing

Why didn't Boeing produce its own regional jet?

Unlock My Phone! February 2018

files created then deleted at every second in tmp directory

Are British MPs missing the point, with these 'Indicative Votes'?

What is an equivalently powerful replacement spell for Yuan-Ti's Suggestion spell?

How exploitable/balanced is this homebrew spell: Spell Permanency?

Forgetting the musical notes while performing in concert

Why was the shrink from 8″ made only to 5.25″ and not smaller (4″ or less)

Getting extremely large arrows with tikzcd

How can a day be of 24 hours?

Is there a hemisphere-neutral way of specifying a season?

Finding the reason behind the value of the integral.

How dangerous is XSS

What does the same-ish mean?

Why are UK visa biometrics appointments suspended at USCIS Application Support Centers?

How does a dynamic QR code work?

What reasons are there for a Capitalist to oppose a 100% inheritance tax?

Send out email when Apex Queueable fails and test it

Could neural networks be considered metaheuristics?

Should I tell management that I intend to leave due to bad software development practices?

Does the Idaho Potato Commission associate potato skins with healthy eating?



why do i get kicked out of a logged in web session?


Why does the cypress recording take too much time?laravel redirection error after session outUnable to create asp.net session on a cookieless web applicationWhy do I get long delays when using LDTP (Cobra/PyATOM)Redirecting to the root URL in servletLogin through a web gateway with Cypress is timing outHow to redirect to an external URL from an Angular2 route's canActivate in Chrome while maintaining Referrer?How to get the text input field value to a const and log that value in Cypress.ioDrop-down menu, redirect dynamically to a link based on choice. When submit button is pressedWhy is cypress timing out when evaluating this regex?How can I imitate a real buying session while using cypress?













0















so i still have the same problem, but this time, my code is not the problem, at least i think so



My Code:



import * as LogConst from 'C:\Users\Kristi\Desktop\BATests\tests\cypress\fixtures\Login_Data.json'

describe('all testcases hopefully', function () {

before(function ()
cy.clearLocalStorage();
cy.clearCookies();

);


it('loading', function ()
cy.visit('https://' + LogConst.server.name + ':' + LogConst.server.password + '@dev.capitalpioneers.de/');
cy.request(
method: 'POST',
url: '/login', // baseUrl is prepended to url
form: true, // indicates the body should be form urlencoded and sets Content-Type: application/x-www-form-urlencoded headers
body:
username: 'LogConst.TestUserCostumer.usercos',
password: 'LogConst.TestUserCostumer.usercospass'

);
// just to prove we have a session
cy.getCookies('cypress-session-cookie').should('exist')
cy.contains('Login').click();
);
it('gets to products', function ()
cy.request('/produkte');
cy.getCookies('cypress-session-cookie').should('exist');
cy.contains('Produkt').click();
cy.url()
.should('include', '/produkte');
);


it('selects Dr. Peters ', function ()
cy.request('/produkt/hotelimmobilie-aachen/');
cy.getCookies('cypress-session-cookie').should('exist');
cy.contains('Dr. Peters').click();
cy.get('#sum_slider[type=range]')
.invoke('val', 50000)
.trigger('change')
);
it('downloads all files and checks the checkboxes', function ()
cy.get('#ga-btn-invest-now-product-detail-hotelimmobilie-aachen').click();
cy.contains('Fondsprospekt').click();
cy.contains('Wesentlichen Anlegerinformationen').click();
cy.get('#pre_check_inGermany').click(force: true);
cy.get('#pre_check_readDocument1').click(force: true);
cy.get('#pre_check_readDocument2').click(force: true);
// cy.pause();
cy.get('.button.button.button--full-width.button--yellow.js-outbrain-invest[type=submit]').click();
);


after clicking on the last button i get kicked out and redirected to the log in page instead of getting to the next page which should have this url:



https://dev.capitalpioneers.de/investor/investment/dynamic changing number/investieren/



what is the prboblem? I don't get any error messages










share|improve this question


























    0















    so i still have the same problem, but this time, my code is not the problem, at least i think so



    My Code:



    import * as LogConst from 'C:\Users\Kristi\Desktop\BATests\tests\cypress\fixtures\Login_Data.json'

    describe('all testcases hopefully', function () {

    before(function ()
    cy.clearLocalStorage();
    cy.clearCookies();

    );


    it('loading', function ()
    cy.visit('https://' + LogConst.server.name + ':' + LogConst.server.password + '@dev.capitalpioneers.de/');
    cy.request(
    method: 'POST',
    url: '/login', // baseUrl is prepended to url
    form: true, // indicates the body should be form urlencoded and sets Content-Type: application/x-www-form-urlencoded headers
    body:
    username: 'LogConst.TestUserCostumer.usercos',
    password: 'LogConst.TestUserCostumer.usercospass'

    );
    // just to prove we have a session
    cy.getCookies('cypress-session-cookie').should('exist')
    cy.contains('Login').click();
    );
    it('gets to products', function ()
    cy.request('/produkte');
    cy.getCookies('cypress-session-cookie').should('exist');
    cy.contains('Produkt').click();
    cy.url()
    .should('include', '/produkte');
    );


    it('selects Dr. Peters ', function ()
    cy.request('/produkt/hotelimmobilie-aachen/');
    cy.getCookies('cypress-session-cookie').should('exist');
    cy.contains('Dr. Peters').click();
    cy.get('#sum_slider[type=range]')
    .invoke('val', 50000)
    .trigger('change')
    );
    it('downloads all files and checks the checkboxes', function ()
    cy.get('#ga-btn-invest-now-product-detail-hotelimmobilie-aachen').click();
    cy.contains('Fondsprospekt').click();
    cy.contains('Wesentlichen Anlegerinformationen').click();
    cy.get('#pre_check_inGermany').click(force: true);
    cy.get('#pre_check_readDocument1').click(force: true);
    cy.get('#pre_check_readDocument2').click(force: true);
    // cy.pause();
    cy.get('.button.button.button--full-width.button--yellow.js-outbrain-invest[type=submit]').click();
    );


    after clicking on the last button i get kicked out and redirected to the log in page instead of getting to the next page which should have this url:



    https://dev.capitalpioneers.de/investor/investment/dynamic changing number/investieren/



    what is the prboblem? I don't get any error messages










    share|improve this question
























      0












      0








      0








      so i still have the same problem, but this time, my code is not the problem, at least i think so



      My Code:



      import * as LogConst from 'C:\Users\Kristi\Desktop\BATests\tests\cypress\fixtures\Login_Data.json'

      describe('all testcases hopefully', function () {

      before(function ()
      cy.clearLocalStorage();
      cy.clearCookies();

      );


      it('loading', function ()
      cy.visit('https://' + LogConst.server.name + ':' + LogConst.server.password + '@dev.capitalpioneers.de/');
      cy.request(
      method: 'POST',
      url: '/login', // baseUrl is prepended to url
      form: true, // indicates the body should be form urlencoded and sets Content-Type: application/x-www-form-urlencoded headers
      body:
      username: 'LogConst.TestUserCostumer.usercos',
      password: 'LogConst.TestUserCostumer.usercospass'

      );
      // just to prove we have a session
      cy.getCookies('cypress-session-cookie').should('exist')
      cy.contains('Login').click();
      );
      it('gets to products', function ()
      cy.request('/produkte');
      cy.getCookies('cypress-session-cookie').should('exist');
      cy.contains('Produkt').click();
      cy.url()
      .should('include', '/produkte');
      );


      it('selects Dr. Peters ', function ()
      cy.request('/produkt/hotelimmobilie-aachen/');
      cy.getCookies('cypress-session-cookie').should('exist');
      cy.contains('Dr. Peters').click();
      cy.get('#sum_slider[type=range]')
      .invoke('val', 50000)
      .trigger('change')
      );
      it('downloads all files and checks the checkboxes', function ()
      cy.get('#ga-btn-invest-now-product-detail-hotelimmobilie-aachen').click();
      cy.contains('Fondsprospekt').click();
      cy.contains('Wesentlichen Anlegerinformationen').click();
      cy.get('#pre_check_inGermany').click(force: true);
      cy.get('#pre_check_readDocument1').click(force: true);
      cy.get('#pre_check_readDocument2').click(force: true);
      // cy.pause();
      cy.get('.button.button.button--full-width.button--yellow.js-outbrain-invest[type=submit]').click();
      );


      after clicking on the last button i get kicked out and redirected to the log in page instead of getting to the next page which should have this url:



      https://dev.capitalpioneers.de/investor/investment/dynamic changing number/investieren/



      what is the prboblem? I don't get any error messages










      share|improve this question














      so i still have the same problem, but this time, my code is not the problem, at least i think so



      My Code:



      import * as LogConst from 'C:\Users\Kristi\Desktop\BATests\tests\cypress\fixtures\Login_Data.json'

      describe('all testcases hopefully', function () {

      before(function ()
      cy.clearLocalStorage();
      cy.clearCookies();

      );


      it('loading', function ()
      cy.visit('https://' + LogConst.server.name + ':' + LogConst.server.password + '@dev.capitalpioneers.de/');
      cy.request(
      method: 'POST',
      url: '/login', // baseUrl is prepended to url
      form: true, // indicates the body should be form urlencoded and sets Content-Type: application/x-www-form-urlencoded headers
      body:
      username: 'LogConst.TestUserCostumer.usercos',
      password: 'LogConst.TestUserCostumer.usercospass'

      );
      // just to prove we have a session
      cy.getCookies('cypress-session-cookie').should('exist')
      cy.contains('Login').click();
      );
      it('gets to products', function ()
      cy.request('/produkte');
      cy.getCookies('cypress-session-cookie').should('exist');
      cy.contains('Produkt').click();
      cy.url()
      .should('include', '/produkte');
      );


      it('selects Dr. Peters ', function ()
      cy.request('/produkt/hotelimmobilie-aachen/');
      cy.getCookies('cypress-session-cookie').should('exist');
      cy.contains('Dr. Peters').click();
      cy.get('#sum_slider[type=range]')
      .invoke('val', 50000)
      .trigger('change')
      );
      it('downloads all files and checks the checkboxes', function ()
      cy.get('#ga-btn-invest-now-product-detail-hotelimmobilie-aachen').click();
      cy.contains('Fondsprospekt').click();
      cy.contains('Wesentlichen Anlegerinformationen').click();
      cy.get('#pre_check_inGermany').click(force: true);
      cy.get('#pre_check_readDocument1').click(force: true);
      cy.get('#pre_check_readDocument2').click(force: true);
      // cy.pause();
      cy.get('.button.button.button--full-width.button--yellow.js-outbrain-invest[type=submit]').click();
      );


      after clicking on the last button i get kicked out and redirected to the log in page instead of getting to the next page which should have this url:



      https://dev.capitalpioneers.de/investor/investment/dynamic changing number/investieren/



      what is the prboblem? I don't get any error messages







      url-redirection cypress gui-testing






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 7 at 21:04









      Kristi SuliKristi Suli

      535




      535






















          1 Answer
          1






          active

          oldest

          votes


















          1














          This is expected behavior in Cypress. I believe you have to preserve the cookies post every it()/ context(),






          beforeEach('Preserve the cookies to persist the state', () => 
          Cypress.Cookies.preserveOnce('sessionid', 'csrftoken')
          )





          In the above script sessionid and csrftoken are the token names which I want to preserve/ retain after each test.



          An alternative is to whitelist the cookie tokens which you want to preserve,



          Cypress.Cookies.defaults(whitelist: 'sessionid');





          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%2f55052760%2fwhy-do-i-get-kicked-out-of-a-logged-in-web-session%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            This is expected behavior in Cypress. I believe you have to preserve the cookies post every it()/ context(),






            beforeEach('Preserve the cookies to persist the state', () => 
            Cypress.Cookies.preserveOnce('sessionid', 'csrftoken')
            )





            In the above script sessionid and csrftoken are the token names which I want to preserve/ retain after each test.



            An alternative is to whitelist the cookie tokens which you want to preserve,



            Cypress.Cookies.defaults(whitelist: 'sessionid');





            share|improve this answer



























              1














              This is expected behavior in Cypress. I believe you have to preserve the cookies post every it()/ context(),






              beforeEach('Preserve the cookies to persist the state', () => 
              Cypress.Cookies.preserveOnce('sessionid', 'csrftoken')
              )





              In the above script sessionid and csrftoken are the token names which I want to preserve/ retain after each test.



              An alternative is to whitelist the cookie tokens which you want to preserve,



              Cypress.Cookies.defaults(whitelist: 'sessionid');





              share|improve this answer

























                1












                1








                1







                This is expected behavior in Cypress. I believe you have to preserve the cookies post every it()/ context(),






                beforeEach('Preserve the cookies to persist the state', () => 
                Cypress.Cookies.preserveOnce('sessionid', 'csrftoken')
                )





                In the above script sessionid and csrftoken are the token names which I want to preserve/ retain after each test.



                An alternative is to whitelist the cookie tokens which you want to preserve,



                Cypress.Cookies.defaults(whitelist: 'sessionid');





                share|improve this answer













                This is expected behavior in Cypress. I believe you have to preserve the cookies post every it()/ context(),






                beforeEach('Preserve the cookies to persist the state', () => 
                Cypress.Cookies.preserveOnce('sessionid', 'csrftoken')
                )





                In the above script sessionid and csrftoken are the token names which I want to preserve/ retain after each test.



                An alternative is to whitelist the cookie tokens which you want to preserve,



                Cypress.Cookies.defaults(whitelist: 'sessionid');





                beforeEach('Preserve the cookies to persist the state', () => 
                Cypress.Cookies.preserveOnce('sessionid', 'csrftoken')
                )





                beforeEach('Preserve the cookies to persist the state', () => 
                Cypress.Cookies.preserveOnce('sessionid', 'csrftoken')
                )






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 8 at 3:59









                Kondasamy JayaramanKondasamy Jayaraman

                453312




                453312





























                    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%2f55052760%2fwhy-do-i-get-kicked-out-of-a-logged-in-web-session%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

                    AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

                    Алба-Юлія

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