JMeter: Response Data is different from expected - jmeter

Im having a problem during performance test using JMeter. While recording the scripts, im using Data A as a sample. Then i use CSV Data Config which consist Data A too.
Once execution completed, I find out that transaction for Data A is passed while others failed to complete transaction.
Expected Response
for(;;);[{"syncId": 8, "clientId": 8, "changes" : [["change",{"pid":"0"},["0",{"id":"0","location":"http:\/\/***:8080\/aa_stg\/#!PatientDashboardView"},["css-injections",{},["css-string",{"id":332},".dashboard .v-panel-bcolor {border: 1px solid #fafafa !important; background-color: #fafafa !important;}"],["css-string",{"id":333},".p_margin {margin:5px;}"],["css-string",{"id":334},".dashboard .v-button-nobackgroundcust {padding: 0px !important;background: transparent;border: none !important;box-shadow: none !important;font-weight:bold;"]
Actual Response:
for(;;);[{"syncId": 8, "clientId": 8, "changes" : [["change",{"pid":"0"},["0",{"id":"0","location":"http:\/\/***:8080\/aa_stg\/#!BedManagementView"}]],["change",{"pid":"359"},["22",{"id":"359"}]],["change",{"pid":"46"},["22",{"id":"46"}]],["change",{"pid":"358"},["3",{"id":"358","iem":"LAZY","iet":400,"nvc":true}]],["change",{"pid":"35"},["23",{"id":"35","ormoh":false,"usehtml":true},["options",{},["moreItem",{"text":""}]],["items",{},["item",{"id":2,"style":"user-menu-caption","text":"<span class=\"noti-menu-badge\">0<\/span>","icon":"theme:\/\/img\/annoucement.png"},["item",{"id":3,"text":"Announcement","command":true}],["item",{"id":4,"text":"Update\/Create New Announcements","command":true}]
Thank you in advance for sharing your valuable suggestion.

Yeah, it show different view because only Data A getting the right response and go to next page while other data are stuck at the current page. I dont think it cause by sessionID

Related

DeleteButton triggers "Incorrect Element"

I'm implementing an asp.net core API with admin-on-rest.
A custom REST client communicates to the API endpoints, but the mapping is fairly standard.
When I try to implement a into the interface, the deletion of elements works fine. Still, I get an error on every edit or deletion view for an element with the following text: "Incorrect Element". The console is empty, and everything works as expected.
What causes the error - and how can I solve this?
I've attached a screenshot of the error popup.
Screenshot of the error
Update 1:
Here is the code of my custom REST client: customrestclient gist and the included fetch.js: fetch.js
Double check your custom restClient returns at least the id of the deleted resource inside a data object.
I was finally able to fix the issue. One of my API endpoints returned a list instead of a single element for one of my ReferenceInput-elements.
This was the content response before my change:
[{
"languageId": 2,
"id": 2,
"name": "Danish",
"isoCode": "dan"
}]
And this is the correct response, that does not trigger the error:
{
"languageId": 2,
"id": 2,
"name": "Danish",
"isoCode": "dan"
}

RethinkDB: Realtime Changes On Array, return only newly appended

Brief: I'm using RethinkDB's change feeds to watch changes on a specific document (not the entire table). Each record looks like this:
{
"feedback": [ ],
"id": "bd808f27-bf20-4286-b287-e2816f46d434" ,
"projectID": "7cec5dd0-bf28-4858-ac0f-8a022ba6a57e" ,
"timestamp": Tue Aug 25 2015 19:48:18 GMT+00:00
}
I have one process that is appending items to the feedback array, and another process that needs to watch for changes on the feedback array... and then do something (specifically, broadcast only the last item appended to feedback via websockets). I've got it wired up so that it will monitor updates to the entire document - however, it requires receiving the complete document, then getting just the last item in the feedback array. This feels overly heavy, when all I need to get back is the last thing added.
Current code used to update the document:
r.table('myTable').get(uuid)
.update({feedback:r.row('feedback').append('message 1')})
.run(conn, callback)(...}
^ That will run several times over the course of a minute or so, adding the latest message to 'feedback'.
Watching changes:
r.table('myTable').get(uuid)
.changes()
.run(conn, function(err, cursor){
cursor.each(function(err, row){
var indexLast = row.old_val ? row.old_val.feedback.length : 0,
nextItem = row.new_val.feedback[indexLast];
// ... do something with nextItem
})
})
Finally, here's the question (2 parts really):
1: When I'm updating the document (adding to feedback), do I have to run an update on the entire document (as in my code above), or is it possible to simply append to the feedback array and be done with it?
2: Is the way I'm doing it above (receiving the entire document and plucking the last element from feedback array) the only way to do this? Or can I do something like:
r.table('myTable').get(uuid)
.changes()
.pluck('feedback').slice(8) // <- kicking my ass
.run(conn, function(err, cursor){
cursor.each(function(err, row){
var indexLast = row.old_val ? row.old_val.feedback.length : 0,
nextItem = row.new_val.feedback[indexLast];
// ... do something with nextItem
})
})
Let's go over your questions
1: When I'm updating the document (adding to feedback),
do I have to run an update on the entire document (as in my code above),
No, you don't. As you did, you only update feedback field. Not an entirely document, doesn't it?
or is it possible to simply append to the feedback array and be done with it?
It's possible. And you already do it.
The way it writes looks like your client driver has to fetch content of feedback array, then append a new element, and update the whole content back. But that's not the case here. The whole query r.row('feedback').append('message 1') is serialized as a JSON string and pass to the RethinkDB. RethinkDB run it, atomically, on the server. The content of feedback and the appending isn't done on client nor sending back to server.
If you used tcpdump like this:
tcpdump -nl -w - -i lo0 -c 500 port 28015|strings
You can see this JSON string is sender to RethinkDB server when you run your query:
[1,[53,[[16,[[15,["myTable"]],1]],[69,[[2,[3]],{"feedback":[29,[[170,[[10,[3]],"feedback"]],"doc2"]]}]]]],{}]
Yes, that single JSON query was transmited over network, not the whole document. Hope it makes sense. More information of that JSON string can be found on http://rethinkdb.com/docs/writing-drivers/ and https://github.com/neumino/rethinkdbdash/blob/master/lib/protodef.js#L84
2: Is the way I'm doing it above (receiving the entire document and plucking the last element from feedback array) the only way to do this? Or can I do something like:
Ideally we will want to use bracket to get a field of document, and listen for change on that field. Unfortunately it doesn't work yet. So we have to use map to transform it. Again, this run on server and only the last document transmit to client, not the whole document:
r.table('myTable').get(1).changes().map(function(doc) {
return doc('new_val')('feedback').default([]).nth(-1)
})

Stop json data getting sorted in chrome

I have been facing the problem with feature of Chrome. Just came to know after debugging.
An ajax call is made to get data from the server (which has been ordered from the server). But the problem is chrome is sorting the response JSON object.
The below object has been taken from ajax response. But just sorts the object based on the key.
I don't have problem with IE or Firefox
{
"83":"4",
"65":"AV",
"64":"AV HY",
"59":"CAM",
"10":"CAM Y H",
"56":"CO",
"18":"FJ CR"
}
After sorting the object looks like this
{
"10":"CAM Y H",
"18":"FJ CR",
"56":"CO",
"59":"CAM",
"83":"4",
"64":"AV HY",
"65":"AV"
}
How can I fix this?
I have done the sorting in the client side using array sort. Thanks for the input Rink

How do I retrieve step count data from Google Fitness REST api?

Since I installed the Google Fit app on my Nexus 5 it has been tracking my step count and time spent walking. I'd like to retrieve this info via the Google Fitness REST api (docs) but I can't work out how to get any of that data from the REST api.
I've used the OAuth 2.0 playground to successfully list dataSources but none of the examples I have tried have returned any fitness data whatsoever. I feel like I need to use something similar to a DataReadRequest from the (Android SDK) but I'm not building an Android app -- I just want to access fitness data already stored by the Google Fit app.
Is it even possible to get the data gathered by the Google Fit app? If so, how can I read and aggregate step count data using the REST api?
It turns out that the answer is in the docs after all. Here is the format of the request.
GET https://www.googleapis.com/fitness/v1/users/{userId}/dataSources/{dataSourceId}/datasets/{datasetId}
The only supported {userId} value is me (with authentication).
Possible values for {dataSourceId} are avaiable by running a different request.
The bit I missed was that {datasetId} is not really an ID, but actually where you define the timespan in which you are interested. The format for that variable is {startTime}-{endTime} where the times are in nanoseconds since the epoch.
I was able to get this working by going through the google php client and noticed that they append their start and finish times for the GET request with extra 0's - nine infact.
Use the same GET request format as mentioned in an answer above:
https://www.googleapis.com/fitness/v1/users/{userId}/dataSources/{dataSourceId}/datasets/{datasetId}
Now here is an example with the unix timestamp (php's time() function uses this)
https://www.googleapis.com/fitness/v1/users/me/dataSources/derived:com.google.step_count.delta:com.google.android.gms:estimated_steps/datasets/1470475368-1471080168
This is the response I get:
{
"minStartTimeNs": "1470475368",
"maxEndTimeNs": "1471080168",
"dataSourceId":
"derived:com.google.step_count.delta:com.google.android.gms:estimated_steps
}
However if you append your start and finish times with nine 0's that you put in your GET requests and shape your request like this:
https://www.googleapis.com/fitness/v1/users/me/dataSources/derived:com.google.step_count.delta:com.google.android.gms:estimated_steps/datasets/1470475368000000000-1471080168000000000
It worked - this is the response I got:
{
"minStartTimeNs": "1470475368000000000",
"maxEndTimeNs": "1471080168000000000",
"dataSourceId":
"derived:com.google.step_count.delta:com.google.android.gms:estimated_steps",
"point": [
{
"modifiedTimeMillis": "1470804762704",
"startTimeNanos": "1470801347560000000",
"endTimeNanos": "1470801347567000000",
"value": [
{
"intVal": -3
}
],
"dataTypeName": "com.google.step_count.delta",
"originDataSourceId": "raw:com.google.step_count.delta:com.dsi.ant.plugins.antplus:AntPlus.0.124"
},
The response is a lot longer but I truncated it for the sake of this post. So when passing your datasets parameter into the request:
1470475368-1471080168 will not work, but 1470475368000000000-1471080168000000000 will.
This did the trick for me, hopes it helps someone!
I tried post method with below URL & body. This will work, please check inline comments too.
Use URL: https://www.googleapis.com/fitness/v1/users/me/dataset:aggregate
Method: POST
Body:
{
"aggregateBy": [{
"dataTypeName": "com.google.step_count.delta",
"dataSourceId": "derived:com.google.step_count.delta:com.google.android.gms:estimated_steps"
}],
"bucketByTime": { "durationMillis": 86400000 }, // This is 24 hours
"startTimeMillis": 1504137600000, //start time
"endTimeMillis": 1504310400000 // End Time
}

millenial media titanium zero content length returned

I have appcelerator and am trying to use millennial-media to deploy ads.
Currently I am receiving the following error message:
Millennial ad return failed. Zero content length returned.
Can someone tell me the steps I need to take to resolve this?
My code for the ad is:
return millennialMediaModule.createView({
apid: "blahblah"
bottom: 0,
width: 320,
height: 50,
adType: millennialMediaModule.TYPE_BANNER
});
ah, i got it wrong.
first you'll need an apid - go to the developer page and then the "aps and sites" to get one), let's say they give you the apid of "1". now you put that into your code:
millennialMediaModule.createView({
apid: "1", //this here is it!
bottom: 0,
width: 320,
height: 50,
adType: millennialMediaModule.TYPE_BANNER
});
now run this, and nothing will happen. you need to get your device id - run your app once with the millennial module trying to call an ad - and then you'll get told your "device id".
it will be in the logs , under something like
[INFO] : MillennialMediaSDK: Diagnostic - ********** Millennial Device Id *****************
then you need (and this is undocumented everywhere but here!) to to go the millennial developer's page (the same one you got your apid from, then "aps and sites" and then "test devices") and enter that id - the device id - there.
for some reason you can give it a name, pick whatever you like (i called mine "name").
NOW you rerun your ap, keep the apid the same as what you originally generated (in this example, "1") and hooray! you have an ad! probably!
the device id, then, doesn't appear in your code, only on their site. the apid appears in both your code, and their site (and should be the same in both!)

Resources