cypress: Unable to login into salesforce 23 using session id
Current behavior
Until the salesforce 23 release which released around a month back, cypress was able to login into salesforce through soap request. However after salesforce 23 release, cypress is unable to log into salesforce which i believe is global issue as others too are facing it.
Below are the steps :
- soap request payload as
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com">
<soapenv:Body>
<urn:login>
<urn:username>username@example.com</urn:username>
<urn:password><<password>><<session_id>></urn:password>
</urn:login>
</soapenv:Body>
</soapenv:Envelope>
- Then passing above payload as request to log into SF as below,
Cypress.Commands.add("loginAsTestUser", () => {
cy.readFile("soapRequestBodyTestUser.xml").then(
(requestBody) => {
cy.request({
method: "POST",
url: "https://test.salesforce.com/services/Soap/u/35.0",
headers: {
SOAPAction: "abc",
["Content-Type"]: "text/xml"
},
body: requestBody
}).then((response) => {
const sessionID = Cypress.$(response.body).find("sessionId").text();
cy.visit("https://xxx--qa.sandbox.lightning.force.com/secur/frontdoor.jsp?sid="+sessionID);
});
}
);
});
-
After calling above command in cypress runner, cypress is unable to move ahead of salesforce 23 logo

-
Also we could see below exception in cypress logs which was not there before salesforce 23 release,

Desired behavior
No response
Test code to reproduce
SOAP request payload as
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:partner.soap.sforce.com">
<soapenv:Body>
<urn:login>
<urn:username><<salesforce_username>></urn:username>
<urn:password><<password>><<session_id>></urn:password>
</urn:login>
</soapenv:Body>
</soapenv:Envelope>
Then passing above payload as request to log into SF as below,
Cypress.Commands.add("loginAsTestUser", () => {
cy.readFile("soapRequestBodyTestUser.xml").then(
(requestBody) => {
cy.request({
method: "POST",
url: "https://test.salesforce.com/services/Soap/u/35.0",
headers: {
SOAPAction: "abc",
["Content-Type"]: "text/xml"
},
body: requestBody
}).then((response) => {
const sessionID = Cypress.$(response.body).find("sessionId").text();
cy.visit("https://xxx--qa.sandbox.lightning.force.com/secur/frontdoor.jsp?sid="+sessionID);
});
}
);
});
-
After calling above command in cypress runner, cypress is unable to move ahead of salesforce 23 logo

-
Also we could see below exception in cypress logs which was not there before salesforce 23 release,

Cypress Version
10.8.0
Node version
v14.20.0
Operating System
Windows 10 Enterprise
Debug Logs
No response
Other
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 15 (7 by maintainers)
@Rogeriohsjr thanks so much for the test project! I was able to reproduce the issue with that. Going to route this to one of our internal teams to take a look at
This is a blocker for most Salesforce tests. Once Salesforce roll out the latest Winter 23 across all environments then everyone using Cypress for Salesforce tests will be failing. Can the Cypress team prioritise this? Thanks.
Many thanks @Rogeriohsjr for supporting out here. Hope this issue gets resolved soon
@astone123 @cypress-app-bot Is there any update on this? This has been a blocker for us since last couple of months. If this is something cant be resolved do let us know so that we can switch to other tool? Kindly respond ASAP