In learning Playwright, I've learned about browser vs context (or browserContext according to playwright). From my understanding, Browser represents an actual browser instance (Chrome/Firefox/etc..) whereas Browser Context is an isolated instance that multiple "Pages" are ran on, (From my understanding a Page is literally a tab/page representation.
So I understand Browser, and Page.......but im a little bit confused at what "Context" actually is.
What exactly is a Browser Context in a easy to explain way. I'm assuming it's close to what selenium considers a "session"?
Browser, in Playwright is the actual browser which is launched. Each broser instance has its own separate environment and it does not share data with other browser instances. Browser context on the other hand is set of pages, cookies and browser storage. Its like a separate tab. One browser instance can have multiple browser context meaning, browser context share the same browser instance. Yet browser context are isolated from eachother.
In summary, a browser is the entire web browser instance, while a browser context is a specific environment within that browser instance. Using multiple browser contexts can be useful for scenarios where you want to isolate tasks or maintain separate user sessions within the same browser instance.