Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using CSV file to read test data from

I need to test a various links of a site (no need to login) with 100's of users and loop it for some number of times using JMeter. I want to put those links in a "CSV file", so that all the links to be tested are read from file.

How do I accomplish this task?

like image 752
user2003333 Avatar asked Jan 23 '13 09:01

user2003333


People also ask

What is CSV file in selenium?

CSV Files with selenium A CSV (Comma Separated Values) file is a text based format that represents the data typically found in a spreadsheet or a database table. It is a common format for data interchange as it is simple, compact, and used everywhere.

How can I split a dataset from a .CSV file for training and testing?

You should use the read_csv () function from the pandas module. It reads all your data straight into the dataframe which you can use further to break your data into train and test. Equally, you can use the train_test_split() function from the scikit-learn module.


1 Answers

Prepare kind of csv-file with list of your test-params and use it to parametrize your test-samplers, using at least the following:

  1. CSV Data Set Config

    Look into the following links for details:

    How to get Jmeter to use CSV data for GET parameters?
    Use jmeter to test multiple Websites
    use csv parameters in jmeter httprequest path
    Force a thread to use same input line when using CSV Data Set Config

  2. Jmeter functions:

    • __CSVRead,
    • __StringFromFile.
  3. Variables From CSV sampler from jmeter-plugins.


1. Prepare your test-urls in csv-file, e.g. in the following format:

    url1
    url2
    ...
    urlN

Ensure that test-URLs don't contain http:// prefix (as per HTTP Request params -> Server).

2. Use schema for your script as below:

    CSV Data Set Config:
    Filename: [path to your csv-file with test-urls]
    Variable Names: testURL
    Recycle on EOF?: True
    Stop thread on EOF?: False
    Sharing mode: Current thread

    Thread Group:
    Number of Threads: N
    Loop Count: M
            HTTP Request // your http call
            Server Name or IP: ${testURL} // use variable with extracted URL

This will start N users, each users will read M entries from list of test-urls. If M > number of entries in list of test-urls then user will recycle the list on EOF.

like image 170
Aliaksandr Belik Avatar answered Oct 22 '22 02:10

Aliaksandr Belik