https://cypress.io logo
Cypress-Base64
# i-need-help
a
Hello guys, I'm new to Cypress API testing, I have a Base64data string (it has over 150000 characters) which I need to encode... I'm trying to copy it from SoapUI... Any idea how can I make this as a file and then do cy.readFile, or how can I use another method to encode this base64 string? Thanks a lot everyone
this is the base64data in SoapUI
d
try this: 1-pass this value into a json and save it in your fixtures directory 2-do the reading from you json and put it on a variable with cy.fixture('filename').then((base64data) => {//put the code here}) 3-now base64data has the string you need atention: filename does not need '.json' when called inside cy.fixture()
a
Thanks a lot, I did it with some research online, I did it exact the same way you mentioned it 🙂 @delightful-guitar-3252
8 Views