jmeter ${__V(longitude_${__counter(,)})} use inside foreach controller - foreach

I have referred this thread Passing two variables in a ForEach controller in jmeter and able to pass multiple variables into the foreach controller
In foreach controller I am using URL variable which works fine and iterate through all the results from previous response extraction. But when I use ${__V(longitude_${__counter(,)})} it doesn't reset to 0 and when I hot the 2nd iteration item it doesn't match. how Is it possible?

Function __counter is by default global, to make it per user, set first argunent as TRUE.in your case:
${__V(longitude_${__counter(TRUE,)})}
TRUE if you wish each simulated user's counter to be kept independent and separate from the other users.

Related

Filtering Smarttables initial read request

im using a sap Smarttable to display my data from an ABAP Backend server. Additionally im using SmartVariantManagement to apply Variants and make them persistent.
The problem in my Application is the initial Load of the Smarttable. It seems like the table is first loading all the available data without any filters from the inital Variant of my Smartvariantmanagement.
Is there any way to apply the filters of Smartvariantmanagement to the initial Load in the Smarttable?
Or even better: Is it possible to shut down a running odata-read request if i apply a new selection in the smartfilterbar and just run the new one instead?
example 1:
you can avoid the initial request by the smarttable property
enableAutoBinding="false"
you can also set some mandatory fields for filtering, now the user performces an explicit call to the database
example 2:
you can also define a filter in the smarttable function
beforeRebindTable="onBeforeRebindTable"
controller:
onBeforeRebindTable: function (oEvent) {
var oBindingParams = oEvent.getParameter("bindingParams");
oBindingParams.filters.push(new sap.ui.model.Filter("PropertyX", "EQ", "myProperty"));
}
regards

Lua variable variables

I'm very new to Lua, I'm working with it on an io controller which has strict limits on script sizes so I need to work within these limits.
I have a number of relays which I am controlling (1-64). I need to switch off a relay when an event happens, but the relay I'm switching off can change.
I have a variable that holds the relay number and I need to turn off this relay.
I can achieve this using I statements:
if variable = 1 then
io.relay1=0 //Turns off the relay
end
else if variable = 2 then
io.relay2=0 //Turns off the relay
end
However, this will very quickly become a large script when repeated for the 64 relays. Is it possible to address the relay using the value of the variable as the relay name? Similar to the below:
io.relay{variable}=0 //Turns off the relay1/2/3/4/5 etc. depending on the value of variable
Alternatively, is there another way to keep the code compact?
Use
io["relay".. variable]=0
However, this creates a string every time.
If you can change how io works, a better solution would be to make io.relay a table and then simply do io.relay[variable]=0.
To avoid the string allocation issue that lhf's answer has, you could pre-generate a string table and index into that:
relay_names = {}
for k = 1,64 do
relay_names[k] = "relay"..tostring(k)
end
Then setting the IO states would look something like this:
io[relay_names[1]] = 1

How to pass multiple variable in a For -Each Controller of Jmeter

{"seatNumb":null,"seqNum":1,"myJourneyID":${MYID},"primaryDoc":null,"secdoc":null}
I have the above request in a for-each controller where i can control myJourneyID but in all the request the seqNum also changes. How to control both the variable in a single for-each ?
As per JMeter version 3.3 you can use only a single variable in the ForEach Controller. If you need to amend this seqNum value as well go for __counter() function or Counter test element and implement iteration on second variable manually.
More information: How to Use a Counter in a JMeter Test

How to get the last inserted row via Odata service

Update:
Using ODATA, How to get the last inserted row in /MySet where MySet.Name = "abc".
I do not want to continuously poll the odata service via model.read(). I know attachChange() or attachDataReceived()methods can be use to get notified automaically. But apart from notification, how to get the 'inserted row'. Also My doubt is how to satisfy the following three conditions here : $top=1, $orderby= Date desc and $filter=NAME eq 'ABC'
The only solution I can think of is to get notified by data inserted via attachDataReceived() and then make a model.read() call with the required filters and additional parameters. Although this would result in these additional 'read' calls.
Original Post Below:
Question: How to pass filters in element binding?
Post: I am using odata service for populating my views.
I want to pass certain filters like $filter=NAME eq 'Scott'
Since I want these parameters to be included only when with odata request for a specific ui-element, I want to include them in bindElement()
specifically something like this
var myFilter = new Array();
myFilter.push(new sap.ui.model.Filter("NAME", sap.ui.model.FilterOperator.EQ, 'Scott'));
var myStandardTile = this.byId("__tile3");
myStandardTile .bindElement("/MySet",{filters:myFilter});
But unfortunately this does not works. When I see the 'network' tab in developer console, Filters are not being added with my request.
You cannot. Neither filter nor sorter nor formatter are supported by element bindings. They are only supported by list and tree bindings.

JavaFX Bindings.BindContentbidirectional removes all observableList Contents?

i have a problem in JavaFX Binding, I have two observable Lists one of them is static, so when i bind them using (Bindings.bindcontentbidirectional), the two lists get empty and i checked by printing their size and the console shows before binding "List 1 = 3" "List 2 = 0" and after the Bind command the two lists size is ZERO!,so what is the problem??, another question, does it matter in a bidirectional bind who comes in the first parameter???
Yes, the order of the parameters does matter. When creating the Binding, the first list will be cleared and filled with the content of the second list. After this point, they will be synchronized bidirectionally as long as the Binding exists.
Assuming you did something like Bindings.bindContentBidirectional(list1, list2), your first list has been cleared upon creating the Binding because list2 was empty at that point. So everything went as to be expected.

Resources