response.url()
and apicontext
in @playwright/testFrom the information we have, it's unclear what response.url()
reports in @playwright/test. It's not explicitly described in the provided content links.
import { test } from '@playwright/test';
test('Check response URL', async ({ page }) => {
const response = await page.goto('https://ray.run/');
console.log(response.url());
});
As for apicontext
, it's not a recognized entity in the @playwright/test documentation. You might be referring to "APIRequestContext" or "APIRequest", but without more context, it's hard to say why it would call a UI URL instead of an API URL.
import { test } from '@playwright/test';
test('APIRequestContext example', async ({ page }) => {
// hypothetical APIRequestContext usage
});
For more information on how to use @playwright/test, you might find these blog posts helpful:
If you still have questions, please ask a question and I will try to answer it.
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 [email protected].