Closed monzerhijazi closed 3 years ago
Also need this functionality
You should be able to set target
to one of the targets and then use full URLs in actual request specs.
What about WebSocket? How can I have multiple targets (eg: connect to one auth server, after auth responds with login info connect to the actual content server while using the ws
engine?
There is a dirty workaround for this: target: "http:/" .... scenarios:
It's not ideal but it should work
Do we still need this workaround in 2019?
Faced with the same issue, workaround works, but it would be really good to see official solution for that
I also need this for an app with multiple websocket servers.
Can you use HTTP and WS in the same file ?
I have the same problem where my web application needs to connect to both http requests and a websocket. Is there a way to configure both https and wss requests in the same file?
I also would like to execute one test for WS and HTTP in the same configuration file and the environment config too.
You should be able to set
target
to one of the targets and then use full URLs in actual request specs.
This works as advertised : the target is used by default but is overridden if you specify a different target in the url.
I'm trying to use 2 different URLs in my scenarios, but I'm seeing odd things in the console. I have a phase set with duration 10, arrivalRate 100, but artillery runs past 10 seconds.
I tried the method mentioned here https://github.com/artilleryio/artillery/issues/303#issuecomment-329448547 but it does not work.
I'm trying to use 2 different URLs in my scenarios, but I'm seeing odd things in the console. I have a phase set with duration 10, arrivalRate 100, but artillery runs past 10 seconds.
I tried the method mentioned here #303 (comment) but it does not work.
Just tested locally - works for me. Be sure that you define https:/
(one slash!) in target, and url is starting from second slash (/host.com/endpoint
). When I tried at first I did a mistake by defining https://
(with 2 slashes) in target and I had "Invalid URL" error message. If this is not your case, please share the config that you are using and the output.
I did exactly as you mentioned, based on the comment I linked. Uses https:/
as the target, and it did not work.
@paul-uz I think we can move from "guesses" mode to "investigation" mode in case you share the config that you are using and the output that you've got. Also, there shouldn't be a big hopes that it should work as this is a hacky workaround and not the official supported feature.
@fabasoad thank you for jumping in to help out! :) @paul-uz would you mind creating a new Discussion please, as what you're seeing is unlikely to be a bug in Artillery.
I am going to close this issue. Multiple URLs as described in the original comment have always been supported. Here's an example of a working script:
config:
target: https://artillery.io
phases:
- arrivalCount: 1
duration: 1
scenarios:
- flow:
- get:
url: "/"
- get:
url: "https://github.com/"
- get:
url: "http://neverssl.com/"
A few folks asked about mixing multiple engines in the same scenario (e.g. HTTP + WS). It's not supported right now (unless you write custom JS code), but it's something we're planning to add in Artillery v2. New issue to track: https://github.com/artilleryio/artillery/issues/1005
@hassy is there a way to have the different stats for each URL displayed in the reports?
Effectively, the report treats both URLs as being one the same target host, and does not differentiate between them in the report, meaning the report is useless if you define different URLs, say one for a staging server, and one for production.
@paul-uz yep, with https://github.com/artilleryio/artillery-plugin-metrics-by-endpoint
I have a scenario where I'm load testing 3 connected web applications (with one that provides a logged in session cookie) Is there any way to have one test file that can have multiple targets? I tried setting the URL on each request and not providing a target at all and that didn't work.
What I was thinking of doing:
config: phases:
scenarios: