Giter Site home page Giter Site logo

Comments (2)

bernardobridge avatar bernardobridge commented on May 20, 2024

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.

from artillery.

sruthii38 avatar sruthii38 commented on May 20, 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

  1. 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)

  2. 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.

playwright:
userAgent: '***'

yml:
extraHTTPHeaders:
User-Agent: ''
userAgent: '
'

Can you please help me if there is a work around for this scenario

from artillery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.