Rayrun
← Back to Discord Forum

Playwright unusable, chromium bug

Hi everyone !

I recently started to learn about playwright as i was told it was "way better than bs4 and selenium"....

Well actually when i made a basic script, and tested it, no way to make it work.

i get (ERROR tests/test_search.py::test_basic_duckduckgo_search[chromium] - playwright._impl._api_types.Error: Executable doesn't exist at C:\Users\flosr\AppData\Local\ms-playwright\chromium-1071\chrome-win\chrome.exe ). The solutions found on internet to upgrade the robot framework thing are useless. I upgraded everything, but playwright still continues to search by default into a directory that doesnt exist. I also saw that theres another command to be made after this upgrade script to be made but it tells me theres no node to be deleted. This framework is actually unusable.

How can you guys successfully use this ? Thank you in advance for your time !

Capture_decran_2023-07-19_201109.png
Capture_decran_2023-07-19_201400.png

This thread is trying to answer question "How can you guys successfully use this?"

5 replies

looks like it can't find the chromium browser. What happens when you do playwright install ?

@.graff: Thank you for your reply ! theres a long thread, then it tells me Webkit 17.0 (playwright build v1869) downloaded to C:\Users\flosr\AppData\Local\ms-playwright\webkit-1869.

Thank you for your reply ! theres a long thread, then it tells me Webkit 17.0 (playwright build v1869) downloaded to C:\Users\flosr\AppData\Local\ms-playwright\webkit-1869.

If it didn't throw any errors after the install command, I'd retry your tests and see if you get the same runtime error again.

@.graff: Ohh it seemed to run, it didnt open no page, i guess its headless by default but no error this time ! Thank you very much 🙂

Ohh it seemed to run, it didnt open no page, i guess its headless by default but no error this time ! Thank you very much 🙂

Capture_decran_2023-07-19_211622.png

Yeah headless is default

Answer

Best Practices for Using Playwright

To make the most out of Playwright, follow these best practices:

Use Web First Assertions

Web first assertions like toBeVisible() ensure accurate testing. They wait for the expected condition to be met before proceeding. Here's an example:

await expect(page.locator('text="Alert message"')).toBeVisible();

Avoid Manual Assertions

Don't use manual assertions that aren't awaiting the expect statement. Instead, use web first assertions to make sure the test waits for the locator to be present.

Debugging

For debugging, you have two options:

Local Debugging in VSCode

Install the VS Code extension and run tests in debug mode. This opens a browser window and pauses at the breakpoint.

Playwright's Inspector

Run tests with the --debug flag to use Playwright's built-in inspector.

npx playwright test --debug

Use the Right Tools

The VS Code extension offers test generation and locator suggestions. TypeScript works out of the box with Playwright, providing better IDE integrations.

Test Across All Browsers

Use Playwright's configuration file (playwright.config.ts) to define projects for different browsers or devices.

Keep Your Playwright Dependency Up-to-Date

Update your dependency using npm:

npm install -D @playwright/test@latest

Check the release notes for the latest version and any changes that have been made.

For more tips, check out Mastering Playwright Test Automation: Your Comprehensive Cheat Sheet.

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email luc@ray.run.