Reports are not getting generated in Newman when any one test fails - postman

When any one request of a Postman collection fails, reports are not getting generated in Newman. Execution will end showing error containing text "response.toJSON"

Issue can be resolved by making below changes:
Open the HTML file (path: npm\node_modules\newman\lib\reporters\html)
Comment the line reducedExecution.response = reducedExecution.response.toJSON();
Save the file and re-execute the script.
That's it!

Related

tbl_summary Error message in UseMethod("ungroup")

I have a tbl_summary which outputs great when run in a script, however I am writing a report in rmarkdown and every time I knit to pdf I get an error message:
Error in UseMethod("ungroup")
(see image below)
Why is this happening? All the variables are continuous except for 'Region' which is what I'm grouping by. Again it outputs fine until I go to knit the file.

JMeter extract 500 errors from list of URLs and output them in a csv file

I'm running JMeter 5.4 (via Jenkins) to work through a long list of URLs (from a .txt file) in order to check that they have a 200/301 Status Code.
When I run the test, some of them fail, so what I'd like to do is somehow extract any URLs that have a 500 status code, and then output these (just the 500 status code URLs) to a separate csv file so I can easily see what URLs fail.
I would also like to be able to view this (500 failure) new csv file in Jenkins (I have the performance module up and running), but think I'll try and walk before I run! :)
Is this possible, and if so how would I go about extracting 500 status code URLs in JMeter?
Any help would be greatly appreciated.
You can use a Listener like Simple Data Writer in order to store the failed requests URLs into a file, example configuration for Simple Data Writer:
You can use a JSR223Post processor to write the URLs to a CSV file.
Add a JSR223_PostProcessor to your HTTP Request as a child element
Inside the script area check the response code (=='500') and write the URL
println("Before checking the response code ")
if (prev.getResponseCode().equalsIgnoreCase("500")) {
//print
println("Start writing to file ")
FileWriter fstream = new FileWriter("failed-urls.csv",true);
fstream.write(vars.get('URL')+"\n");
fstream.close();
}
Methods available from the previous sample result (prev variable) can be found in API documentation.
JSR223 Post Processor need to be places as a child element to the HTTP Request

Server is returning cached file

I am creating the following anchor tag dynamically, to download the file I receive from flask backend. The url in a.href is always constant. But the content of output.mp4 keeps on changing.
However, the content of file I get on a.click() is not changing. The file I get is the one I created atleast 3-4 hours ago. How do I get the updated file, on each a.click() call?
var a = document.createElement('a')
a.href = 'http://localhost:5000/download/output'
a.setAttribute('download', 'output.mp4')
a.click()
This is almost 100% to do with the cache setup on the backend.
A simple solution would be to append a cache breaking flag on the output, such as
a.setAttribute('download', 'output.mp4?cachebuster=' + Date.now())

jaggery command line script does not execute the jaggery script in the argument

I tried writting some jaggery expressions in a separate .jag file and tried executing it as follows
./jaggery.sh file.jag
The output is just the content in the file. Whatever i have in the file is printed to the console.
i.e if i have
print("hello"); in file.jag
the output is print("hello"); whereas my expected output is hello
Try like following
<%
print('hello');
%>
And, It's mentioned that,
Jaggery CMD is still experimental, and is for developer preview. You
are welcome to play with it and please do provide us your
feedback

Editing Files With Flask-Admin

I am using Flask-Admin to provide an admin interface for my web app, and so far everything has gone well. However, I am trying to make it so that the .TXT files can be edited right in the browser.
Reading the docs, I have incorporated the line:
editable_extensions = ('txt')
into my FileAdmin class. However, every time I check the box beside the file and press With Selected -> Edit, I get a "Permission Denied" error. On the contrary, the Rename feature works fine, and I can also click the file name to view the contents.
Does anyone have any idea how to solve this problem, or where I should start looking?
Note that I may very well be missing some required code, as the line above is all I have done with regards to the editing functionality.
EDIT: I have now managed to get:
Unexpected error while reading from filename.txt
This file cannot be edited for now.
Never mind, this was fixed in an update. For those curious as to what the issue was, the edit() function in fileadmin.py was opening the file as 'r', rather than 'rb'. This caused the error:
'str' object has no attribute 'decode'
which consequently produced in error in the very end.