Selecting values from a fixed set at random in JMeter - arrays

The problem I'm trying to solve is how to go about randomizing HTTP requests with multiple available values of parameters one would manually select via a drop-down list. I'm doing this in JMeter so AFAIK I cannot just declare an array containing values of parameters that said drop-down list options refer to and then use random indices for values.
For the sake of simplifying the problem - let's say I'm writing a test plan where a thread searches for a book title in an e-bookstore and goes to 'view' a found item. I want to start a buch of threads but don't want them all to search for the same book. I do know all titles available but do not know how to make each thread search for a different one.
I could try defining a varable per value and use __RandomFromMultipleVar() with all variables as its parameters but that would be quite a chunky piece of code if I wanted to select from more than just a few values.
If there's a way of defining multivalue variables, it would realy come in handy.

You can add User defined Variables under Http Request with name and value
Example:
Name= option_1;option_2; option_3 and different Values for each option.
User Defined Values Example
In Http request body add below code in place where you enter value.
"${__V(option_${__Random(1,3,)})}"

Related

How to get the number (length) of slot values for Alexa skill

I am trying to generate a random response for my Alexa Skill. I have set it up as:
Intent = myIntent
Slot = mySlot
Slot Type = mySlotType
Slot Values = {A,B,C,D} //the ids are unique numbers 1 - 4
when the user says a word such as A it uses this to create a response. Now I want to add a case for 'random'.
So Slot Values = {random,A,B,C,D}. //ID for random is 0
When the user says random, I want to randomly choose from the other Slot Values and use this to create a response.
Can Slot Value ID be used to return the Slot Value value?
Anybody know a good way to do this? I am a novice so excuse any obvious oversights.
This might be a workaround for your problem. You can get the JSON structure of your interaction model and use it as a constant in your lambda index.js file. I usually use this official tool for generating backend code for my skill
:
https://s3.amazonaws.com/webappvui/skillcode/v2/index.html.
When you'll generate the code through this tool, you'll see that the code generated also has the whole interaction model used as constant. Since you will have the whole JSON schema of the interaction model at your disposal, you can perform any action on it.
Note: If you don't know where to get JSON schema of your interaction model, scroll down on the build tab of your skill on the developer console, you'll find a menu of JSON editor on the left navigation. It will give you the JSON schema of your interaction model.
You can use mySlot as optional value in the intent description. For example you can add few utterances without slot inside them. And on the backend side you can check is the slot filled. If it is not filled you can generate random answer.

Azure Search: rotationFromOriginal not properly populated

As I am reading here, "when the imageAction is set to generateNormalizedImages, the new normalized_images field will contain an array of images. Each image is a complex type" which should contain a very important field for my scenario (rotationFromOriginal).
I noticed that, even if Azure Search perfectly accomplish the rotation of the images, this property will always be 0 (unlike other fields as originalWidth, which are correctly populated).
Do you know why I have this issue? Am I the only one?
AFAIK, the value of rotationFromOriginal was in normalized_images and it was as an input, so it must be populated at first.
And use the parameters in normalized_images json file to rotation and process image. For more details, you could refer to this article.

I need to create an array for "Forms" to be called randomly

I have 4 forms (beside the main form) that I would like to store in an array and called randomly. The forms contain web pages with YouTube video clips that autoplay. When I use them individually in the code they work as expected. I am having trouble getting them to play from an array.
Consider the following approaches:
If the four forms are identical except for the specific YouTube URL, consider consolidating them to a single form. You can send the URL to the new form via the constructor. An array of strings is much easier to create.
You could generate a random integer (between 1 and 4). Use as Select myRandomInteger statement with a Case to initialize and show the form for that integer value (index).
Finally, if you post the non working code, perhaps someone will have a more specific solution for you.

Is there a clean way of users managing their own locations?

A lot of my site is dynamically generated dependant on the user location.
To get an initial fix I am currently using the Smart_IP module which does this based on the user IP address - which works great as a starting point. I can access $_SESSION['smart_ip']['location']['longitude'] & $_SESSION['smart_ip']['location']['latitude'] as required - perfect!
But I need to allow my user to override this..
Using HTML5 geolocation. I want to only do this on user request, ie click 'locate me', rather than requesting their location uninvited.
Using one of a few pre-defined locations selectable by the user.
Using an inputed address by the user.
Is there any drupal module I can use for this, or how else could I achieve it?
-
Just to clarify, I am talking about anonymous users here - the general public visiting my site. I just want them to be able to refine their 'location' by overriding the defaults I give them using smart_ip.
I suggest to use Geolocation field and all it's submodules or Geofield. Last one provides more input methods.
Use the Address field module to allow the user create multiple addresses into a node (or even into his profile), Geocoder module to get the lon/lat from these addresses and then a Views to display them in a list.
Same as 2 but without views.
If you want to allow user select one of the 3 methods you can use an other - helper - field (eg a select list with the 3 options).
Finally you should add an extra field to store the lat/lon pair final values maybe with Computed field module or 2 simple textfields that will get the selected values through javascript.

How to use loops in JasperReports .jrxml file?

I am using iReport Designer to design the .jrxml file.
How can I use the for loop or if loop in .jrxml file?
Is it possible?
If yes how?
You may wish to use a scriptlet. It's basically a Java class that extends either of the following two classes:
net.sf.jasperreports.engine.JRAbstractScriptlet
net.sf.jasperreports.engine.JRDefaultScriptlet
In a scriptlet, you can indicate that a certain piece of code should be executed every time a report event occurs, e.g., report, page, or column initialization.
In a scriptlet, you may use loops. You may access fields, parameters, and variable values. You may also adjust variable values.
There is a chapter on scriptlets in the JasperReports Ultimate Guide.
Well what you can do is create a list of selected fields(which client UI selects) and pass it as a collection to JasperFillManager.fillReport and in the jrxml create a field names _THIS which will represent the value's in the List.
And as you want those field to printed in loop, place them in the detail band of the report.

Resources