Comments (2)
how can we add header like HTTP header manger in web socket sampler.?
from jmeter-websocketsampler.
You can use HeaderManager for changing the request headers.
1)Add this code in the source WebSocketSampler.java
private void fillHttpHeadersElement(ClientUpgradeRequest request) {
JMeterProperty property = JMeterContextService.getContext().getCurrentSampler().getProperty("HeaderManager.headers");
ArrayList objectValue = (ArrayList) property.getObjectValue();
for (int i = 0; i < objectValue.size(); i++) {
JMeterProperty next = objectValue.get(i);
Header header = (Header) next.getObjectValue();
request.setHeader(header.getName(), header.getValue());
}
}
- In
"private ServiceSocket getConnectionSocket() throws URISyntaxException, Exception"
method, you can call this method (fillHttpHeadersElement) .
//Start WebSocket client thread and upgrage HTTP connection
webSocketClient.start();
ClientUpgradeRequest request = new ClientUpgradeRequest();
///>>>
fillHttpHeadersElement(request);
///>>>
webSocketClient.connect(socket, uri, request);
from jmeter-websocketsampler.
Related Issues (20)
- Websocket testing JMeter Configuration
- extract().response() not working for REST assured. Getting error as "The method extract() is undefined for the type"
- How to identify disabled elements in dropdown in selenium with java? HOT 1
- WebSocket can't connect to remote server HOT 1
- Failing under heavy load HOT 4
- HTTP Header Manager parameters not passed
- Creating more threads on server than specified.
- can't receive expected response message for expected sampler
- Unable to create new connections per iteration- websocket sampler HOT 1
- Cannot get all data for frame
- excuse me?
- Unexpected error: null when run multiple threads
- WebSocket Sampler hangs on for 5000ms HOT 1
- Only the response pattern from first sampler is used
- java.util.LinkedList$ListItr.checkForComodification(Unknown Source)
- weird resizing of config window HOT 3
- WebSocket Connection "Got unexpected status 503"
- issue that i can't explain, on websocket sampler, the jmeter screen keeps on getting wider and wider HOT 4
- Able to connect to socket, but only getting sids and not message I expect
- unable send subprotocols in ws request
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jmeter-websocketsampler.