to use loop controller to access the rows from CSV sequencially - jmeter

I am new to J meter, i have a question like prepared a CSV as shown below, Now i want to use loop controller to access the rows from CSV sequencially. Please help on this. I need to execute loop for 5 times and each loop has to pick next row.
Fname Lname
west1 east1
west2 east2
west3 east3
Please help me the settings to use loop counter for the same.
Thanks,
VB

Take a look the examples provided with JMeter. See the example of CSV reading in %JMETER_HOME%\bin\examples\CSVSample.jmx. It is pretty simple and obvious case.

Related

VB6 Timestamp / datediff()?

I have a series of steps say 1-10 and some of the steps repeat multiple times. I am able to record the time stamp do some simple calculation and write it into a text file at the steps where I want but the problem is when the same step repeats again it is recording it again. How can I record this timestamp only once at the start of the step and not record again when the step repeats?
Thank you!
You haven't provided many details so the answer might be not relevant. As an option, you can use a flag variables declared somewhere outside of your steps. For example for step one:
Private Step1Called As Boolean
Later, when you enter your step number 1 you can add something like this, where RecordTimeStamp is a function creating and manipulating your timestamp:
If Not Step1Called Then
RecordTimeStamp
Step1Called = True
End If

Dynamic Variable creation and using the Same variable in a loop in Shell

I am stuck with a Requirement but stuck in a Scenario, tried out lot of alternatives from Google but looks like not serving my Purpose.
Below is my Requirement-
tablename=$1
This is a Variable for which the value i get from the command line.
Now my requirement is i want to create a variable with the Name which i received in the variable called tablename.
And i want to use that variable in a loop further.
For Example :
Say,
tablename = dept1
Now my loop will look something like-
for dept1 in .... do
...
done
Can someone please help me with this..

Mockaroo Formulas for random date range using Ruby

I am trying to create a data field using Mockaroo and they say they have Ruby support but I know nothing about Ruby so I am trying to find out how to do a field that will randomly choose between the 3 options.
now() or
now()+days(-1) or
now()+days(-2) or
now()+days(-3)
Idea 1
I was initially thinking something using random like now()+days(this.rand(-3))
Idea 2
I also thought of using or logic like now() or now()+days(-3) or etc...
This answer may end up being different than a typical ruby solution since Mockaroo has their own little API to use too... Appreciate any help that can be given.
Turns out I had to use the random function first and pass in min and max date parameters.
random(now()+days(2), now()+days(-3))

Read Dates as Strings with Spreadsheet Ruby Gem

I have been looking for a way to read out an Excel spreadsheet with keeping the dates that are in them being kept as a string. Unfortunately I can't see if this is possible or not, has anyone managed to do this or know how?
You may want to have a look at the Row class of the spreadsheet gem:
http://spreadsheet.rubyforge.org/Spreadsheet/Row.html
There's a lot that you can get there, but the Row#formatted method is probably what you want:
row = sheet.to_a[row_index] # Get row object
value = row.formatted[column_index]
The formatted method takes all the Excel formatting data for you and gives you an array of Ruby-classed objects
I think you can try row.at(col_index) method..
You can refer to this page

Pass data from workspace to a function

I created a GUI and used uiimport to import a dataset into matlab workspace, I would like to pass this imported data to another function in matlab...How do I pass this imported dataset into another function....I tried doing diz...but it couldnt pick diz....it doesnt pick the data on the matlab workspace....any ideas??
[file_input, pathname] = uigetfile( ...
{'*.txt', 'Text (*.txt)'; ...
'*.xls', 'Excel (*.xls)'; ...
'*.*', 'All Files (*.*)'}, ...
'Select files');
uiimport(file_input);
M = dlmread(file_input);
X = freed(M);
I think that you need to assign the result of this statement:
uiimport(file_input);
to a variable, like this
dataset = uiimport(file_input);
and then pass that to your next function:
M = dlmread(dataset);
This is a very basic feature of Matlab, which suggests to me that you would find it valuable to read some of the on-line help and some of the documentation for Matlab. When you've done that you'll probably find neater and quicker ways of doing this.
EDIT: Well, #Tim, if all else fails RTFM. So I did, and my previous answer is incorrect. What you need to pass to dlmread is the name of the file to read. So, you either use uiimport or dlmread to read the file, but not both. Which one you use depends on what you are trying to do and on the format of the input file. So, go RTFM and I'll do the same. If you are still having trouble, update your question and provide details of the contents of the file.
In your script you have three ways to read the file. Choose one on them depending on your file format. But first I would combine file name with the path:
file_input = fullfile(pathname,file_input);
I wouldn't use UIIMPORT in a script, since user can change way to read the data, and variable name depends on file name and user.
With DLMREAD you can only read numerical data from the file. You can also skip some number of rows or columns with
M = dlmread(file_input,'\t',1,1);
skipping the first row and one column on the left.
Or you can define a range in kind of Excel style. See the DLMREAD documentation for more details.
The filename you pass to DLMREAD must be a string. Don't pass a file handle or any data. You will get "Filename must be a string", if it's not a string. Easy.
FREAD reads data from a binary file. See the documentation if you really have to do it.
There are many other functions to read the data from file. If you still have problems, show us an example of your file format, so we can suggest the best way to read it.

Resources