Slow performance when testing non-local IP services with Playwright

37 views Asked by At

image:network logs When using Playwright (version 1.42.1) to test services hosted on the local machine using localhost or 127.0.0.1 with Chrome 108 and Chromium 100 browsers on Windows 7 Professional, the testing process is fast. However, when testing services hosted on the local machine's IP address (e.g., 10.132.xxx.xxx) or other IP addresses within the same intranet, the testing process becomes significantly slower.

my code:

import { test, expect } from '@playwright/test';
test('test', async ({page }) => {
  await page.goto('http://10.13.xxx.xxx:8080/test');
  await page.getByRole('button', {name: "Login"}).click()

  await page.waitForTimeout(5000);

});

Services can be any web project, such as a simple project containing multiple JavaScript files, Vue projects, etc

Environment: Playwright Version: 1.42.1 Operating System: Windows 7 Professional Browsers: Chrome 108, Chromium 100 Network Condition: Intranet environment

Playwright should be able to test services within the same intranet environment, including those hosted on the local machine's IP address, with similar performance as testing services using localhost or 127.0.0.1.

1

There are 1 answers

0
mu liu On

I have resolved the issue by adding the startup parameters --proxy-server='direct://' --proxy-bypass-list=*, although I am not sure of the exact reason.