How to get query string parameter from request url from cy.wait() #17137
ThaiChingChong
started this conversation in
General
Replies: 1 comment 1 reply
-
You can parse the URL using browser api methods, see https://github.com/cypress-io/cypress-example-recipes/blob/f9550225b97efbae2efd150d4ca7b417c297d6a6/examples/stubbing-spying__intercept/cypress/integration/form-spec.js#L22 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Is there a way to extract the list of query string parameter from a network request url using cy.wait() to spy on a network request?
I am currently intercepting/spying a network request of an ads request. I then use cy.wait() to spy on the network requests
This request url contains a long list of query string parameters in an encoded format. eg:
https://securepubads.g.doubleclick.net/gampad/ads?gdfp_req=1&pvsid=891762924179292&correlator=1770039353370680&output=ldjh&impl=fifs&eid=31061423%2C31061664%2C31061703%2C21067497%2C21068031%2C31061003%2C31061425%2C31061218%2C31061661%2C31061420&vrg=2021062205&ptt=17&gdpr_consent=CPE6CeSPE6CeSA.
Is there a way I can extract the the list of query string parameter easily and assert its value? eg: gdfp_req=1, pvsid=891762924179292, correlator=1770039353370680, output=ldjh
Beta Was this translation helpful? Give feedback.
All reactions