You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have default headers that are configured in playwright.config.ts and it worked when running playwright test. When I call the same playwright test through artillery, it is not working.
This default config is specific to header.
I tried specifying config in different sections
config:
engines:
playwright:
contextOptions:
extraHTTPHeaders:
User-Agent: '****'
I have also tried setting at artillery default as well
config:
http:
defaults:
headers:
User-Agent: "*****"
None of these options worked.
Can you suggest a way to make this work?
The text was updated successfully, but these errors were encountered:
Hi @sruthii38, the extraHTTPHeaders option should work (but not the config.http option).
Can you please share your config + scenario using Github Code Blocks? Without the proper formatting it's difficult to say what might be wrong.
sruthii38
changed the title
Utilizing default Playwright config values through Artillery
Headers in default Playwright config values are not being reflected in Artillery performance tests
Mar 26, 2024
@bernardobridge Hi, the extraHTTPHeaders is working for initial URL load but the user on our website will get redirected by generating 302 status and authorize through headers but the default headers specified in Playwright are not being picked by artillery(Spec file in playwright is doing expected). So here are two problems
The headers that Playwright passes from Playwright.config.ts to spec file execution are not being entirely honored by artillery(Spec file passes on Playwright test spec.js)
The user have to specify the same headers in Playwright again in Artillery yml file as extraHTTPHeaders but still the test fails because Artillery is not carrying the extraHTTPHeaders to redirect Urls and the tests are failing.
To give you more context on the issue I found, the header that is not getting passed to redirect URL is "User-Agent". I can see it is still being the default on redirect URL when extraHTTPHeaders is passing a custom value. On the other hand Playwright spec file is passing the right header(User-Agent) for the entire test and passing the test. But Artillery run is failing. If I add userAgent header to extraHTTPHeaders along with User-Agent like below, the website is getting both headers while User-Agent is still default and userAgent is the custom value but we only need User-Agent for authorization.
I have default headers that are configured in playwright.config.ts and it worked when running playwright test. When I call the same playwright test through artillery, it is not working.
This default config is specific to header.
I tried specifying config in different sections
config:
engines:
playwright:
contextOptions:
extraHTTPHeaders:
User-Agent: '****'
I have also tried setting at artillery default as well
config:
http:
defaults:
headers:
User-Agent: "*****"
None of these options worked.
Can you suggest a way to make this work?
The text was updated successfully, but these errors were encountered: