Jmeter For each Controller - performance-testing

I've created in Jmeter the follwing:
HTTP Request (first one)
(Regular Expression Extractor) for the Response Body (I set the name of the variable, and put the correct regular expression,which works fine and returns the searched pattern)
(ForEach Controller) to iterate the Array (and of course I put the name of the array variable, and the ouput variable name (index))
another subsequent Http Request under (ForEach Controller Level) (then I put the value index of the array on the path like: /${smalpl_index}
Now I expect the second http Request below the (ForEach Controller) make a new Request based on the index Element of the Array from the Regular Expression, however I got null on the request...(see below)
Hier you find all the screenshot of the test scenario:
https://imgur.com/a/Eqbk9Mx#cp5raNc
GET http://edge.flowplayer.org/null

I see only one request in your screenshot and my expectation is that you should have at least one passed HTTP Request (first one)
In the Regular Expression Extractor make sure to set "Match No." to -1
Add Debug Sampler after the HTTP Request (first one) and make sure it contains the variables you're looking for, in order for ForEach Controller to work you need to have the following variables pattern:
var_1=some value
var_2=some other value
etc.
Check out Using Regular Expressions in JMeter article for example of extracting all links from the page and opening them via ForEach Controller.
Also for the majority of HTML responses using Regular Expressions is not the best idea, it might be better to consider CSS Selector Extractor

The problem was in the regular expression template,since I'm searching for the entire pattern , I should not put $1$, instead of $0$,because $1$ means the second group number, and in my case I have one group, and so it works fro me...

Related

Add Parameter Values to Query String of get request in ADF

I have a Copy Data task which is obtaining data from an API
The API is a GET call to a method and requires 2 parameters
_token
Symbols
I have defined these as parameters
What is the syntax that allows me to use the values of my parameters as the values that are in the query string? So in the screenshot above Symbols is hard coded, but I want the value to be the value of the parameters
I need a screen solution rather than code please as I am not comfortable with ADF yet and I dont know how to get to the code/ARM views
Paul
Using a feature called string interpolation where expressions are wrapped in #{ ... }
Click on the Base URL field. Add Parameters. Using Concat expression function,
Example:
#{Concat('https://stackoverflow.com/questions/GetRealTimeRates?',linkedService().Symbols,'=',linkedService()._token)}
Add first parameter:
Add second parameter:
Test connection. If you see any error, it would provide a description as to debug further.

Difference between operators in a URL

What's the difference between using : and ? in a URL? For example /products/:id and /products?id=1? I am trying to get the values from the URL like this Product.findById (req.params.id) but I was wondering which one is most suitable. I know using : do I have to use req.params and ? req.query but I don't understand the difference between them, are they the same?
in my point of view, it is totally different if you are using RESTFUL API pattern
/products/:id called path parameters
The path parameters determine the resource you’re requesting for. Think of it like an automatic answering machine that asks you to press 1 for service, press 2 for another service, 3 for yet another service and so on.
Path parameters are part of the endpoint itself and are not optional
but query parameters
Technically, query parameters are not part of the REST architecture, and they used to help you completely understand how to read and use API’s Query parameters give you the option to modify your request with key-value pairs.
Having your parameters in the query is conceptually optional to the router, query parameters are more of properties and descriptions of the request itself, like when saying GET /users?sort=asc, in this case, the sort attribute was more of a description to the request and the request could complete the fetch without it, that might not always be the case, but a query parameter still describes its request even if it was mandatory.
On the other hand, URL parameters are part of the request itself, the URL without the parameter doesn't make sense, like GET /users/:userID, in this case, not supplying userID will supply unexpected data (A list of users for example) if it didn't break the router completely. URL parameters play part in defining the request rather than just describing it, and they can't be optional.

How to populate an array parameter in a Spotfire URL configurationBlock

So...I managed to create a URL which populates a parameterised information link.
https://myserver-prod.mycompany.net/SpotfireWeb/ViewAnalysis.aspx?file=/Reports/02_Testing/Hyperlink_Parameter_Test&configurationBlock=pCountry%3D%22GERMANY%22%3B
This passes in GERMANY to the pCountry parameter and is working fine.
However, I am not sure how I would push in an array of values. I have changed my parameter to be an array, and am trying different things but they are not working.
This documentation isn't great in this respect.
https://community.tibco.com/wiki/create-configuration-block-tibco-spotfire
I have tried things like this, where I am comma separating the parameters (here I am passing in GERMANY and FRANCE separated by a url encoded comma (%3B).
https://spotfireweb-prod.rd.astrazeneca.net/SpotfireWeb/ViewAnalysis.aspx?file=/GMD/GRAPSQA/ARIEL/Reports/02_Testing/Hyperlink_Parameter_Test_Array&configurationBlock=pCountry%3D%22GERMANY%3BFRANCE%22%3B
A list parameter has the following syntax:
COUNTRY={"GERMANY","FRANCE"};
Used in a URL it must be encoded: COUNTRY%3D%7B%22GERMANY%22%2C%22FRANCE%22%7D
Learn more about configuration blocks here: https://community.tibco.com/wiki/create-configuration-block-tibco-spotfire

Expression Engine - passing multiple categories as URL segments

I'm trying to create a product filter with deep-linking capability. Essentially, I want the user to be able to filter my product list on multiple categories and have the URL reflect the filtering they've done.
So it would start as:
www.site.com/products/
My first level of category filtering already works. So I can use EE's regular handling of URL segments to get to my first level of filtering. For instance:
www.site.com/products/leatherthongs
Returns a filtered subset showing only a spectacular collection of leather thongs. But now I want the user to be able to filter on another category - color for instance. This is where stuff stops working.
EE's way of handling multiple categories inside templates (with ampersands or pipes) doesn't work in the URL:
www.site.com/products/leatherthongs&red
Nor does any variation that I've tried.
My next move is to create a simple raw PHP method that can capture regular querystring parameters and then inject them into the {entries} tag before rendering. Not very difficult, but quite ugly. I would love to know if there is a way to handle multiple categories in the URL natively.
Thanks for your time.
Have you considered using Low's Seg2Cat add-on? I'm not sure how complex you want to make this but it seems that you could specify something in your channel:entries loop like categories='{segment_2){if segment_3}|{segment_3_category_id}{/if}'
This exact syntax is untested but I have had success in the past with a similar solution.

Is there anything that provides the kind of support PHP's filter_var does in ColdFusion?

I've found filter_var to be extremely useful in validating and sanitizing user input with PHP, but I've yet to find anything even remotely as convenient in ColdFusion (more specifically, CF8).
Obviously I can hack together something using REReplace, but that would take significantly more time to code up and would be much uglier than using the pre-defined filters available in PHP. Is there a more efficient way or do I just need to bite the bullet?
There are three different options available to you. Since you're attempting to manage user input, I assume you're using forms. isValid most closely mimics your functionality, allowing you to check if a value specified matches either a data type or a regular expression and returns true or false, and includes attributes by default to define a range. It does not support the ability to create a custom 'filter' beyond defining a regular expression however.
The second option would be using cfparam tags on your POST processing page, which allows you to specify the existance of a variable, test against a data type or define a regular expression, and optionally assign a default value if the variable doesn't exist. If you attempt to process a page where the field is not defined and no default value is assigned however, ColdFusion throws an error.
Finally, you can do validation by using cfform and cfinput fields on your form itself; which allows for client-side data validation for existence and types (it also supports server-side validation but it's implementation is sloppy), regular expressions, and input masking: taking user-inputted data and conforming it to a specific format (like adding dashes to phone numbers and zip codes).

Resources