Parse out token with cypress2019 Community Moderator ElectionHow do I parse a string to a float or int in Python?What is token based authentication?Parsing JSON with Unix toolsHow to parse JSON in JavaParsing values from a JSON file?How Do You Parse and Process HTML/XML in PHP?Parse JSON in JavaScript?Logging into a Django server with Cypress.ioJMeter how to refresh token csrf laravelHow can I imitate a real buying session while using cypress?

In what cases must I use 了 and in what cases not?

Asserting that Atheism and Theism are both faith based positions

How can an organ that provides biological immortality be unable to regenerate?

Optimising a list searching algorithm

Can other pieces capture a threatening piece and prevent a checkmate?

Recruiter wants very extensive technical details about all of my previous work

PTIJ What is the inyan of the Konami code in Uncle Moishy's song?

I got the following comment from a reputed math journal. What does it mean?

Do native speakers use "ultima" and "proxima" frequently in spoken English?

World War I as a war of liberals against authoritarians?

Probably overheated black color SMD pads

gerund and noun applications

Synchronized implementation of a bank account in Java

How to generate binary array whose elements with values 1 are randomly drawn

Why are there no stars visible in cislunar space?

Would it be believable to defy demographics in a story?

Is it insecure to send a password in a `curl` command?

What favor did Moody owe Dumbledore?

What are substitutions for coconut in curry?

How to get the n-th line after a grepped one?

Print a physical multiplication table

Generic TVP tradeoffs?

What is the term when voters “dishonestly” choose something that they do not want to choose?

How is the partial sum of a geometric sequence calculated?



Parse out token with cypress



2019 Community Moderator ElectionHow do I parse a string to a float or int in Python?What is token based authentication?Parsing JSON with Unix toolsHow to parse JSON in JavaParsing values from a JSON file?How Do You Parse and Process HTML/XML in PHP?Parse JSON in JavaScript?Logging into a Django server with Cypress.ioJMeter how to refresh token csrf laravelHow can I imitate a real buying session while using cypress?










-1















I'mt damn frustrated.
I'm a newbi in testing and also in javascript, but i have to write tests for my bachelorthesis.



so that web app I'm testing has a login space, where you can buy different products. I can get two different tokens. the first is about my user Id and the second is about the"shopping cart" (it's not really a shopping cart, cause the buying process is an investment process and the product are real estates)



So Cypress suggests this



 cy.request('POST', 'https://sso.corp.com/auth', username: 'foo', password: 'bar' )
.then((response) =>
// pull out the location redirect
const loc = response.headers['Location']

// parse out the token from the url (assuming its in there)
const token = parseOutMyToken(loc)

// do something with the token that your web application expects
// likely the same behavior as what your SSO does under the hood
// assuming it handles query string tokens like this
cy.visit('http://localhost:8080?token=' + token)

// if you don't need to work with the token you can sometimes
// just visit the location header directly
cy.visit(loc)
)


I did this:



 it('strategy #1: parse token from HTML', function () 
// if we cannot change our server code to make it easier
// to parse out the CSRF token, we can simply use cy.request
// to fetch the login page, and then parse the HTML contents
// to find the CSRF token embedded in the page
cy.request()
.its('body')
.then((body) =>
// we can use Cypress.$ to parse the string body
// thus enabling us to query into it easily
const $html = Cypress.$(body)
const csrf = $html.find('#user_profile__token[name=user_profile[_token]]').val()

cy.loginByCSRF(csrf)
.then((resp) =>
expect(resp.status).to.eq(200)
expect(resp.body).to.include("<h2>dashboard.html</h2>")
)
)
);


It didn't work out although i found this on a github page.
has anyone of you any idea?



User TokenID: input#user_profile__token[name=user_profile[_token]]



Product Token ID: input#product_filter__token[name=product_filter[_token]]



The task is not only parsing the tokens out but also save them while testing in cypress.



Please help



My code which causes that 401 Error:



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

describe('Login & Selection of Investment AIF Dr. Peters', function () {

before(function ()
cy.visit('https://' + LogConst.server.name + ':' + LogConst.server.password + '@dev.capitalpioneers.de/')
cy.contains('Login').click();
cy.url()
.should('include', '/login'));

it('logs in', function ()
cy.get('#email.form-control')
.type(LogConst.TestUserCostumer.usercos);
cy.get('#password.form-control')
.type(LogConst.TestUserCostumer.usercospass);
cy.contains('Anmelden').click();
cy.url().shoul('include','/investor');
);

it('product selection the Dr. Peters Product', function ()
cy.contains('Produkt').click();
cy.url()
.should('include', '/produkte');


it('selects Dr. Peters AIF Product', function ()


cy.contains('Dr. Peters').click();
cy.url().should('include', '/produkt/hotelimmobilie-aachen/');
cy.get('#sum_slider[type=range]')
.invoke('val', 50000)
.trigger('change')
);


it('download nessecary docs', function ()
cy.get('#ga-btn-invest-now-product-detail-hotelimmobilie-aachen').click();
cy.contains('Fondsprospekt').click();
cy.contains('Wesentlichen Anlegerinformationen').click()
);

it('sets the right checks', function ()
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.get('button').contains('Weiter').click();
);

);









share|improve this question
























  • I'm looking for documentation on the Cypress.$. Can't seem to find it

    – Garuuk
    Mar 6 at 23:37






  • 1





    Hi @Garuuk, no i found that on this github site github.com/cypress-io/cypress-example-recipes/blob/master/…

    – Kristi Suli
    Mar 7 at 12:15















-1















I'mt damn frustrated.
I'm a newbi in testing and also in javascript, but i have to write tests for my bachelorthesis.



so that web app I'm testing has a login space, where you can buy different products. I can get two different tokens. the first is about my user Id and the second is about the"shopping cart" (it's not really a shopping cart, cause the buying process is an investment process and the product are real estates)



So Cypress suggests this



 cy.request('POST', 'https://sso.corp.com/auth', username: 'foo', password: 'bar' )
.then((response) =>
// pull out the location redirect
const loc = response.headers['Location']

// parse out the token from the url (assuming its in there)
const token = parseOutMyToken(loc)

// do something with the token that your web application expects
// likely the same behavior as what your SSO does under the hood
// assuming it handles query string tokens like this
cy.visit('http://localhost:8080?token=' + token)

// if you don't need to work with the token you can sometimes
// just visit the location header directly
cy.visit(loc)
)


I did this:



 it('strategy #1: parse token from HTML', function () 
// if we cannot change our server code to make it easier
// to parse out the CSRF token, we can simply use cy.request
// to fetch the login page, and then parse the HTML contents
// to find the CSRF token embedded in the page
cy.request()
.its('body')
.then((body) =>
// we can use Cypress.$ to parse the string body
// thus enabling us to query into it easily
const $html = Cypress.$(body)
const csrf = $html.find('#user_profile__token[name=user_profile[_token]]').val()

cy.loginByCSRF(csrf)
.then((resp) =>
expect(resp.status).to.eq(200)
expect(resp.body).to.include("<h2>dashboard.html</h2>")
)
)
);


It didn't work out although i found this on a github page.
has anyone of you any idea?



User TokenID: input#user_profile__token[name=user_profile[_token]]



Product Token ID: input#product_filter__token[name=product_filter[_token]]



The task is not only parsing the tokens out but also save them while testing in cypress.



Please help



My code which causes that 401 Error:



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

describe('Login & Selection of Investment AIF Dr. Peters', function () {

before(function ()
cy.visit('https://' + LogConst.server.name + ':' + LogConst.server.password + '@dev.capitalpioneers.de/')
cy.contains('Login').click();
cy.url()
.should('include', '/login'));

it('logs in', function ()
cy.get('#email.form-control')
.type(LogConst.TestUserCostumer.usercos);
cy.get('#password.form-control')
.type(LogConst.TestUserCostumer.usercospass);
cy.contains('Anmelden').click();
cy.url().shoul('include','/investor');
);

it('product selection the Dr. Peters Product', function ()
cy.contains('Produkt').click();
cy.url()
.should('include', '/produkte');


it('selects Dr. Peters AIF Product', function ()


cy.contains('Dr. Peters').click();
cy.url().should('include', '/produkt/hotelimmobilie-aachen/');
cy.get('#sum_slider[type=range]')
.invoke('val', 50000)
.trigger('change')
);


it('download nessecary docs', function ()
cy.get('#ga-btn-invest-now-product-detail-hotelimmobilie-aachen').click();
cy.contains('Fondsprospekt').click();
cy.contains('Wesentlichen Anlegerinformationen').click()
);

it('sets the right checks', function ()
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.get('button').contains('Weiter').click();
);

);









share|improve this question
























  • I'm looking for documentation on the Cypress.$. Can't seem to find it

    – Garuuk
    Mar 6 at 23:37






  • 1





    Hi @Garuuk, no i found that on this github site github.com/cypress-io/cypress-example-recipes/blob/master/…

    – Kristi Suli
    Mar 7 at 12:15













-1












-1








-1








I'mt damn frustrated.
I'm a newbi in testing and also in javascript, but i have to write tests for my bachelorthesis.



so that web app I'm testing has a login space, where you can buy different products. I can get two different tokens. the first is about my user Id and the second is about the"shopping cart" (it's not really a shopping cart, cause the buying process is an investment process and the product are real estates)



So Cypress suggests this



 cy.request('POST', 'https://sso.corp.com/auth', username: 'foo', password: 'bar' )
.then((response) =>
// pull out the location redirect
const loc = response.headers['Location']

// parse out the token from the url (assuming its in there)
const token = parseOutMyToken(loc)

// do something with the token that your web application expects
// likely the same behavior as what your SSO does under the hood
// assuming it handles query string tokens like this
cy.visit('http://localhost:8080?token=' + token)

// if you don't need to work with the token you can sometimes
// just visit the location header directly
cy.visit(loc)
)


I did this:



 it('strategy #1: parse token from HTML', function () 
// if we cannot change our server code to make it easier
// to parse out the CSRF token, we can simply use cy.request
// to fetch the login page, and then parse the HTML contents
// to find the CSRF token embedded in the page
cy.request()
.its('body')
.then((body) =>
// we can use Cypress.$ to parse the string body
// thus enabling us to query into it easily
const $html = Cypress.$(body)
const csrf = $html.find('#user_profile__token[name=user_profile[_token]]').val()

cy.loginByCSRF(csrf)
.then((resp) =>
expect(resp.status).to.eq(200)
expect(resp.body).to.include("<h2>dashboard.html</h2>")
)
)
);


It didn't work out although i found this on a github page.
has anyone of you any idea?



User TokenID: input#user_profile__token[name=user_profile[_token]]



Product Token ID: input#product_filter__token[name=product_filter[_token]]



The task is not only parsing the tokens out but also save them while testing in cypress.



Please help



My code which causes that 401 Error:



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

describe('Login & Selection of Investment AIF Dr. Peters', function () {

before(function ()
cy.visit('https://' + LogConst.server.name + ':' + LogConst.server.password + '@dev.capitalpioneers.de/')
cy.contains('Login').click();
cy.url()
.should('include', '/login'));

it('logs in', function ()
cy.get('#email.form-control')
.type(LogConst.TestUserCostumer.usercos);
cy.get('#password.form-control')
.type(LogConst.TestUserCostumer.usercospass);
cy.contains('Anmelden').click();
cy.url().shoul('include','/investor');
);

it('product selection the Dr. Peters Product', function ()
cy.contains('Produkt').click();
cy.url()
.should('include', '/produkte');


it('selects Dr. Peters AIF Product', function ()


cy.contains('Dr. Peters').click();
cy.url().should('include', '/produkt/hotelimmobilie-aachen/');
cy.get('#sum_slider[type=range]')
.invoke('val', 50000)
.trigger('change')
);


it('download nessecary docs', function ()
cy.get('#ga-btn-invest-now-product-detail-hotelimmobilie-aachen').click();
cy.contains('Fondsprospekt').click();
cy.contains('Wesentlichen Anlegerinformationen').click()
);

it('sets the right checks', function ()
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.get('button').contains('Weiter').click();
);

);









share|improve this question
















I'mt damn frustrated.
I'm a newbi in testing and also in javascript, but i have to write tests for my bachelorthesis.



so that web app I'm testing has a login space, where you can buy different products. I can get two different tokens. the first is about my user Id and the second is about the"shopping cart" (it's not really a shopping cart, cause the buying process is an investment process and the product are real estates)



So Cypress suggests this



 cy.request('POST', 'https://sso.corp.com/auth', username: 'foo', password: 'bar' )
.then((response) =>
// pull out the location redirect
const loc = response.headers['Location']

// parse out the token from the url (assuming its in there)
const token = parseOutMyToken(loc)

// do something with the token that your web application expects
// likely the same behavior as what your SSO does under the hood
// assuming it handles query string tokens like this
cy.visit('http://localhost:8080?token=' + token)

// if you don't need to work with the token you can sometimes
// just visit the location header directly
cy.visit(loc)
)


I did this:



 it('strategy #1: parse token from HTML', function () 
// if we cannot change our server code to make it easier
// to parse out the CSRF token, we can simply use cy.request
// to fetch the login page, and then parse the HTML contents
// to find the CSRF token embedded in the page
cy.request()
.its('body')
.then((body) =>
// we can use Cypress.$ to parse the string body
// thus enabling us to query into it easily
const $html = Cypress.$(body)
const csrf = $html.find('#user_profile__token[name=user_profile[_token]]').val()

cy.loginByCSRF(csrf)
.then((resp) =>
expect(resp.status).to.eq(200)
expect(resp.body).to.include("<h2>dashboard.html</h2>")
)
)
);


It didn't work out although i found this on a github page.
has anyone of you any idea?



User TokenID: input#user_profile__token[name=user_profile[_token]]



Product Token ID: input#product_filter__token[name=product_filter[_token]]



The task is not only parsing the tokens out but also save them while testing in cypress.



Please help



My code which causes that 401 Error:



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

describe('Login & Selection of Investment AIF Dr. Peters', function () {

before(function ()
cy.visit('https://' + LogConst.server.name + ':' + LogConst.server.password + '@dev.capitalpioneers.de/')
cy.contains('Login').click();
cy.url()
.should('include', '/login'));

it('logs in', function ()
cy.get('#email.form-control')
.type(LogConst.TestUserCostumer.usercos);
cy.get('#password.form-control')
.type(LogConst.TestUserCostumer.usercospass);
cy.contains('Anmelden').click();
cy.url().shoul('include','/investor');
);

it('product selection the Dr. Peters Product', function ()
cy.contains('Produkt').click();
cy.url()
.should('include', '/produkte');


it('selects Dr. Peters AIF Product', function ()


cy.contains('Dr. Peters').click();
cy.url().should('include', '/produkt/hotelimmobilie-aachen/');
cy.get('#sum_slider[type=range]')
.invoke('val', 50000)
.trigger('change')
);


it('download nessecary docs', function ()
cy.get('#ga-btn-invest-now-product-detail-hotelimmobilie-aachen').click();
cy.contains('Fondsprospekt').click();
cy.contains('Wesentlichen Anlegerinformationen').click()
);

it('sets the right checks', function ()
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.get('button').contains('Weiter').click();
);

);






parsing testing token cypress csrf-token






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 7 at 14:39







Kristi Suli

















asked Mar 6 at 22:12









Kristi SuliKristi Suli

535




535












  • I'm looking for documentation on the Cypress.$. Can't seem to find it

    – Garuuk
    Mar 6 at 23:37






  • 1





    Hi @Garuuk, no i found that on this github site github.com/cypress-io/cypress-example-recipes/blob/master/…

    – Kristi Suli
    Mar 7 at 12:15

















  • I'm looking for documentation on the Cypress.$. Can't seem to find it

    – Garuuk
    Mar 6 at 23:37






  • 1





    Hi @Garuuk, no i found that on this github site github.com/cypress-io/cypress-example-recipes/blob/master/…

    – Kristi Suli
    Mar 7 at 12:15
















I'm looking for documentation on the Cypress.$. Can't seem to find it

– Garuuk
Mar 6 at 23:37





I'm looking for documentation on the Cypress.$. Can't seem to find it

– Garuuk
Mar 6 at 23:37




1




1





Hi @Garuuk, no i found that on this github site github.com/cypress-io/cypress-example-recipes/blob/master/…

– Kristi Suli
Mar 7 at 12:15





Hi @Garuuk, no i found that on this github site github.com/cypress-io/cypress-example-recipes/blob/master/…

– Kristi Suli
Mar 7 at 12:15












1 Answer
1






active

oldest

votes


















0














So a real application would never store tokens in the HTML, so I assume that's why you're having trouble.



If your token needs to end up in localStorage, you can try the following



cy.visit(...)
cy.get('input#user_profile__token').then( $el =>
const token =$el.attr('name')
// Parse the token if needed, if it's not in the correct format
window.localStorage.setItem('user_token', token)

)


But again, it doesn't seem clear what you're even trying to do with the token.






share|improve this answer























  • thank you i'm triying- hmm i think i have to store it while having a session and i think i have to get the cookies. My aim is to get in the buying process without getting the 401 error message.

    – Kristi Suli
    Mar 7 at 14:18











  • I think the is the most anyone can help you. It's not clear what you're trying to do. A session can mean a lot of things.

    – bkucera
    Mar 7 at 14:21






  • 1





    You should generalize your question, "get into the buying process" doesn't mean anything to anyone trying to help you

    – bkucera
    Mar 7 at 14:22











  • I edited the whole case. maybe you unterstand now my problem? I'm sorry that I'm not very specific about that issue, but it's hard for me to explain, when I'm not really understanden what's about. The message I get is "CSRF Token is invalid" but not from cypress- this message is from the tested website. and i would like to know how to solve this, and get to the next page which is "the investment process".

    – Kristi Suli
    Mar 7 at 14:42










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%2f55033008%2fparse-out-token-with-cypress%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









0














So a real application would never store tokens in the HTML, so I assume that's why you're having trouble.



If your token needs to end up in localStorage, you can try the following



cy.visit(...)
cy.get('input#user_profile__token').then( $el =>
const token =$el.attr('name')
// Parse the token if needed, if it's not in the correct format
window.localStorage.setItem('user_token', token)

)


But again, it doesn't seem clear what you're even trying to do with the token.






share|improve this answer























  • thank you i'm triying- hmm i think i have to store it while having a session and i think i have to get the cookies. My aim is to get in the buying process without getting the 401 error message.

    – Kristi Suli
    Mar 7 at 14:18











  • I think the is the most anyone can help you. It's not clear what you're trying to do. A session can mean a lot of things.

    – bkucera
    Mar 7 at 14:21






  • 1





    You should generalize your question, "get into the buying process" doesn't mean anything to anyone trying to help you

    – bkucera
    Mar 7 at 14:22











  • I edited the whole case. maybe you unterstand now my problem? I'm sorry that I'm not very specific about that issue, but it's hard for me to explain, when I'm not really understanden what's about. The message I get is "CSRF Token is invalid" but not from cypress- this message is from the tested website. and i would like to know how to solve this, and get to the next page which is "the investment process".

    – Kristi Suli
    Mar 7 at 14:42















0














So a real application would never store tokens in the HTML, so I assume that's why you're having trouble.



If your token needs to end up in localStorage, you can try the following



cy.visit(...)
cy.get('input#user_profile__token').then( $el =>
const token =$el.attr('name')
// Parse the token if needed, if it's not in the correct format
window.localStorage.setItem('user_token', token)

)


But again, it doesn't seem clear what you're even trying to do with the token.






share|improve this answer























  • thank you i'm triying- hmm i think i have to store it while having a session and i think i have to get the cookies. My aim is to get in the buying process without getting the 401 error message.

    – Kristi Suli
    Mar 7 at 14:18











  • I think the is the most anyone can help you. It's not clear what you're trying to do. A session can mean a lot of things.

    – bkucera
    Mar 7 at 14:21






  • 1





    You should generalize your question, "get into the buying process" doesn't mean anything to anyone trying to help you

    – bkucera
    Mar 7 at 14:22











  • I edited the whole case. maybe you unterstand now my problem? I'm sorry that I'm not very specific about that issue, but it's hard for me to explain, when I'm not really understanden what's about. The message I get is "CSRF Token is invalid" but not from cypress- this message is from the tested website. and i would like to know how to solve this, and get to the next page which is "the investment process".

    – Kristi Suli
    Mar 7 at 14:42













0












0








0







So a real application would never store tokens in the HTML, so I assume that's why you're having trouble.



If your token needs to end up in localStorage, you can try the following



cy.visit(...)
cy.get('input#user_profile__token').then( $el =>
const token =$el.attr('name')
// Parse the token if needed, if it's not in the correct format
window.localStorage.setItem('user_token', token)

)


But again, it doesn't seem clear what you're even trying to do with the token.






share|improve this answer













So a real application would never store tokens in the HTML, so I assume that's why you're having trouble.



If your token needs to end up in localStorage, you can try the following



cy.visit(...)
cy.get('input#user_profile__token').then( $el =>
const token =$el.attr('name')
// Parse the token if needed, if it's not in the correct format
window.localStorage.setItem('user_token', token)

)


But again, it doesn't seem clear what you're even trying to do with the token.







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 7 at 13:38









bkucerabkucera

1,719417




1,719417












  • thank you i'm triying- hmm i think i have to store it while having a session and i think i have to get the cookies. My aim is to get in the buying process without getting the 401 error message.

    – Kristi Suli
    Mar 7 at 14:18











  • I think the is the most anyone can help you. It's not clear what you're trying to do. A session can mean a lot of things.

    – bkucera
    Mar 7 at 14:21






  • 1





    You should generalize your question, "get into the buying process" doesn't mean anything to anyone trying to help you

    – bkucera
    Mar 7 at 14:22











  • I edited the whole case. maybe you unterstand now my problem? I'm sorry that I'm not very specific about that issue, but it's hard for me to explain, when I'm not really understanden what's about. The message I get is "CSRF Token is invalid" but not from cypress- this message is from the tested website. and i would like to know how to solve this, and get to the next page which is "the investment process".

    – Kristi Suli
    Mar 7 at 14:42

















  • thank you i'm triying- hmm i think i have to store it while having a session and i think i have to get the cookies. My aim is to get in the buying process without getting the 401 error message.

    – Kristi Suli
    Mar 7 at 14:18











  • I think the is the most anyone can help you. It's not clear what you're trying to do. A session can mean a lot of things.

    – bkucera
    Mar 7 at 14:21






  • 1





    You should generalize your question, "get into the buying process" doesn't mean anything to anyone trying to help you

    – bkucera
    Mar 7 at 14:22











  • I edited the whole case. maybe you unterstand now my problem? I'm sorry that I'm not very specific about that issue, but it's hard for me to explain, when I'm not really understanden what's about. The message I get is "CSRF Token is invalid" but not from cypress- this message is from the tested website. and i would like to know how to solve this, and get to the next page which is "the investment process".

    – Kristi Suli
    Mar 7 at 14:42
















thank you i'm triying- hmm i think i have to store it while having a session and i think i have to get the cookies. My aim is to get in the buying process without getting the 401 error message.

– Kristi Suli
Mar 7 at 14:18





thank you i'm triying- hmm i think i have to store it while having a session and i think i have to get the cookies. My aim is to get in the buying process without getting the 401 error message.

– Kristi Suli
Mar 7 at 14:18













I think the is the most anyone can help you. It's not clear what you're trying to do. A session can mean a lot of things.

– bkucera
Mar 7 at 14:21





I think the is the most anyone can help you. It's not clear what you're trying to do. A session can mean a lot of things.

– bkucera
Mar 7 at 14:21




1




1





You should generalize your question, "get into the buying process" doesn't mean anything to anyone trying to help you

– bkucera
Mar 7 at 14:22





You should generalize your question, "get into the buying process" doesn't mean anything to anyone trying to help you

– bkucera
Mar 7 at 14:22













I edited the whole case. maybe you unterstand now my problem? I'm sorry that I'm not very specific about that issue, but it's hard for me to explain, when I'm not really understanden what's about. The message I get is "CSRF Token is invalid" but not from cypress- this message is from the tested website. and i would like to know how to solve this, and get to the next page which is "the investment process".

– Kristi Suli
Mar 7 at 14:42





I edited the whole case. maybe you unterstand now my problem? I'm sorry that I'm not very specific about that issue, but it's hard for me to explain, when I'm not really understanden what's about. The message I get is "CSRF Token is invalid" but not from cypress- this message is from the tested website. and i would like to know how to solve this, and get to the next page which is "the investment process".

– Kristi Suli
Mar 7 at 14:42



















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%2f55033008%2fparse-out-token-with-cypress%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 у кіно

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

Ель Греко