Difference of Selenium and Cypress
1. ARCHITECTURE
a. Selenium
1. At the Client, test code using the selenium library will be converted into the content of requests sent to the Browser Driver.
2. These Drivers receive requests and execute on the Browser
3. Then, return the results to the Client.
b. Cypress
1 . The Nodejs process will initialize a browser with a proxy.
2. This browser will be displayed with 2 iframes. One is cypress (domain: localhost) and one is our application (private domain). Because iframes on the browser cannot exchange or interact with each other if the domain is different, a script is installed in the application to change the app's domain to localhost. From there, cypress can access other objects in the app such as DOM, Window, LocalStorage...
3. Cypress also interacts with Nodejs so it can request permissions from the operating system (OS) for tasks such as taking photos or recording videos.
4. Because the browser is initialized with the proxy, cypress can manage the browser's incoming and outgoing network, thereby editing the request and response.