← Back to Discord Forum

How to add a file in FORM data while hitting post api. I am getting 405

anirudh.ruhelaposted in #help-playwright
Open in Discord

using java with playwright

This thread is trying to answer question "How to use Java with Playwright?"

0 replies


Connect Playwright with Selenium Grid using Java

First, set up Selenium Grid and ensure it works with Selenium WebDriver. If you're running a distributed Selenium Grid, register selenium nodes with an accessible address for Playwright to connect to the browsers.

Next, install and configure Java Development Kit (JDK) on your system.


Download the selenium-server JAR file for your desired version of Selenium Grid. Navigate to its location in the terminal and start a selenium node.

SE_NODE_GRID_URL="http://<selenium-hub-ip>:4444" java -jar selenium-server-<version>.jar node

Now, connect Playwright to Selenium Grid 4.

SELENIUM_REMOTE_URL=http://<selenium-hub-ip>:4444 npx playwright test

You can use your existing Java code and testing harness or browserType.launch() as usual. If your grid requires additional capabilities, provide JSON-serialized capabilities by setting the SELENIUM_REMOTE_CAPABILITIES environment variable.

With this setup, Playwright will launch Google Chrome or Microsoft Edge browsers through the Selenium Grid Hub, so you can skip browser downloads.

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

Related Discord Threads

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.