Ask Your Question
4

What is the difference between the browser and context in Playwright?

asked 2023-07-08 19:54:51 +0000

lalupa gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-07-08 20:02:01 +0000

nofretete gravatar image

A browser in Playwright is a running instance of a web browser, such as Chromium, Firefox, or WebKit. It provides an environment for interacting with web pages, including creating pages, navigating to URLs, interacting with page elements, and executing JavaScript code.

A context in Playwright is a single browsing session within a browser. Each context has its own set of cookies, cache, and storage, and can navigate independently of other contexts within the same browser instance. Contexts are useful for testing scenarios where users log in and out of a web application or for isolating test cases in parallel testing.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-07-08 19:54:51 +0000

Seen: 12 times

Last updated: Jul 08 '23