10

I'm new to JMeter and am having trouble figuring out how to get my default URL to be what I want it to be. Right now, I've added an HTTP Request Defaultsconfig element to my test plan. In the Web Server box I have a url of the following format:

testproject.company.com 

What I actually want the default URL to be is

testproject.company.com/test

The first thing I tried was setting the Server Name or IP to testproject.company.com/test, but this gave me an error

java.net.UnknownHostException: testproject.company.com/test

Next, I set Server Name or IP back to testproject.company.com and filled in the Path box in the HTTP Request section with

/test

This does not cause any errors, but all of my tests fail because it is simply using testproject.company.com as the default URL.


I am also using a Project Files config, and within the Configure the CSV Data Source section, in the Filename box, have the path to a .csv file. The .csv file has the following contents:

testproject.company.com/test/,[email protected],10,true,WIN

What's preventing JMeter from adding /test to the default URL?

4 Answers 4

16

I believe the issue is due to a misunderstanding of the Path field under the HTTP Request Defaults section. It appears that the path in that section will only be used for tests where a path is not defined. So instead of adding the path from the test to the default path, it simply replaces it. Because of this, you have to manually add the path to each test that specifies a path.

If anyone knows of a better way to do this, let me know!

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for that update... Its odd though, and lessens the value of the Defaults. It should of course be default and that the Samplers build upon.
11

Use userdefined variables

Declare the "/test" as PATHVARIABLE in a user defined variable.

In each request append the variable to the path ${PATHVARIABLE}/yourUrl

Comments

1

Add "HTTP Sampler" under Thread group. In HTTP Request Defaults define Server IP as testproject.company.com and in HTTP Sampler define "/test" as Path.Leave the Server Name or IP field blank.

Thanks

7 Comments

Where can I find HTTP Sampler?
I already have many HTTP requests, I was hoping there was a way to not have to add /test to every single request
HTTP Request is the HTTP Sampler
Set "/test" as Path in "HTTP Request Default" and set Server IP as "testproject.company.com"
I did that, but it would only set that as the default path for HTTP Requests that don't have a path. What I would like is that all requests start with testproject.company.com/test, then the path in the HTTP request is added onto that
|
0

The first thing I tried was setting the Server Name or IP to testproject.company.com/test, but this gave me an error

java.net.UnknownHostException: testproject.company.com/test

It appears that this error is given depending on which "implementation" you are using for the HTTP Request sampler.

Setting the implementation to anything other than 'Java' (e.g. HttpClient4) solved this problem for me.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.