Why the HTTP Request return that the response is not in JSON format? - dynamics-crm

I built a flow that will generate an SSRS report as PDF dynamically from Dynamics by following this amazing article:
D365 Reports as PDF using Power Automate
After I have followed all the steps mentioned and performed different testing, sometimes the flow calls the API and output, as a result, the content type of the file, and sometimes it fails with the below response using the same report ID:
Inner Error returned:
""innerError": "<html><head><title>Object moved</title></head><body>\r\n<h2>Object moved to here.</h2>\r\n</body></html>\r\n"
Succeeded Run (Without any changes to the flow):
Actions scope screenshot:
-- Updated logic to handle HTTP request:
This flow really scares me as it might and might not work because I will be sending this report to our customers and I want to avoid any issue that might happen to the flow.
Kindly note that if you try to reproduce the same flow you will encounter the same issue.
Any idea what will be the workaround to handle this issue and to avoid flow failure?
Any help is highly appreciated.

I solve this issue adding "Accept: {asterik}/{asterisk}" to the Header. sometimes the request returns the redirect error in this case try to repeat the request making the same request again(using run after setting).
fix screen

Related

handling dynamic pop-up error message in jmeter

I have a Jmeter script for an application for which i get pop up error message intermittently. Where as in jmeter we only come to know that flow got terminated by some failure.But we wont come to know the occurrence of Error pop -up message.
My requirement is if we encounter pop up error i want to write to an external file saying that ,the current page got failed due to pop-up error message.
If we can write the error message it's really great. I'm as of now not getting idea to achieve this.
Please can anyone help me in this. or can provide any hint to do R&D.
Thankyou in advance.
Updated the question with screen shot of error message.
As per JMeter project main page:
JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).
Looking into your screenshot, it is a form of JavaScript popup, most likely window.alert so there is no way to detect it via JMeter.
You can add i.e. Response Assertion to your test in order to introduce some pass/fail criteria, i.e. if you were in the middle of some transaction when the error occurred it should not finish successfully resulting in missing expected entry in the web page (or database), so you can conditionally fail relevant sampler(s) in this case. See How to Use JMeter Assertions in Three Easy Steps to learn more about the concept.
Alternatively you can use WebDriver Sampler plugin which provides JMeter integration with Selenium browser automation framework which drives a real browser, so you will be able to capture this popups and record the page titles/take screenshots, check out IsAlertPresent() class for more information.
you must get this error response in your jmeter request response.simple answer.Have a regex to extract.

Not getting proper response in the tree table after performing login scenario using JMeter

I just started to use JMeter with the tutorial (for a sample website), which returns clear response data.
But, when I started to use in one of my projects, I saw the response was encrypted in View results in tree.
So can anyone provide solution for it? This was the response i was getting
I doubt you haven't check marked 'Use this proxy server for all protocols' while creating manual proxy configuration. By checking/ ticking that check box it will allow you to record the scenarios and also it gives you a proper response.
and I also doubt that you are getting proper server name. By doing the above step it will solve your problem

Post Request is too large in jmeter

Facing the issue while developing the performance script for salesforce application. The issue is, one of the apexremote post call is too large in size. Jmeter is getting hanged if i am trying to click that particular request. Even if I manage to enhance the post request somehow the cursor is not going to end of the line. Hence at the end of the line there is one CSRF which I am not able to correlate. This is only happening for only one apex post request. Because of this my orders are getting rejected while provisioning. I tried by increasing my heapsize in jmeter.bat file but no help.Searched in google but didn't find related queries. I tried the same thing with neoload and I was successfully access and enhanced that particular request.
Has anyone experienced ever! How to resolve this.
Please HELP!
1.Basically for that you need to be Patience after clicking on the request and when the request populate properly copy that post data into notepad++for correlation purpose.
2.Or other solution is Open the .JMX directly into notepad and from there copy the post data into other notepad++ instance and form there with some manipulation you can do correlation.
3.Hope you already changed the property "view.results.tree.max_size=0" in "jmeter.properties" file because may be for next correlation you will get the message like "Response data is to Large".
I had also faced the same issue several times in past, so in that case just copy the complete post body and paste it into notepad++ and modify the content there instead of modifying in jmeter itself, then paste the content back to jmeter and execute it.
This will resolve your issue but have patience while clicking on http request to copy the post body because it'll take some time to open the request properly
I have found out the solution for the very big request for which meter is getting hanged. The best solution is to take the request from the html body of the view result tree listener for the recorded original one and paste in the payload of a new sampler. Then add it in appropriate place accordingly. We can also keep a raw request and make the correlation changes there itself instead of messing around in the big request payload.

What does "HTTP request failed" mean in an rspec/capybara/poltergeist/phantomjs spec?

Even when all tests are passing, I see many many instances of this message amid the successful test output:
...
in the single-post view
behaves like editing a comment
HTTP request failed.
HTTP request failed.
HTTP request failed.
...
What is causing it?
One possibility is that requests made by for example third-party analytics scripts on your page are failing.
You can see their activity by inspecting the output of poltergeist's page.driver.network_traffic at the end of a test.
If you think this is the problem, you could take those scripts out of the picture by
including them in the page only if you're not running tests, or
using poltergeist's page.execute_script to replace appropriate functions in those third-party scripts with no-op functions. (That takes more work but leaves the page contents more production-like, which might catch a few more possible errors.)

Need to debug recorded jmeter script

I recently recorded a test script in Jmeter intended for use as a load test script (using this handy set of instructions. The recording itself worked great and I even figured out how to grab and parametrize the session ids and timestamps. However, if I run the recorded steps just as they were recorded some of them don't work -- they generate "500--Server encountered and internal error ...nested exception is java.lang.NullPointerException" The failing steps are all Ajax calls that populate sidebar elements. If I copy the request GET call (Request tab, ViewResultsTree) and paste it into a browser I get the exact same error. Do I need to record my script differently, or hand-code the ajax calls? Other, earlier steps work correctly and send the expected POST data, so it isn't the application under test or forgotten proxy settings. Currently running against Firefox 3.6.10
Any suggestions on how I can debug this would be greatly appreciated.
The first thing I'd do is determine if the java.lang.NullPointerException is happening on the client side (JMeter) or on your server. If it is happening in JMeter, than something is terribly wrong with either your script or with JMeter.
But assuming that the error is encountered on your server, then looking into the cause of the exception may shed light on what is wrong with the request issued by JMeter. Do you have access to the code where the exception is thrown?
I would also recommend comparing the request in the recording with the request that generated the error. You may need to determine which parts of the request are session-specific and ensure those fields are populated correctly.
It sounds like Jmeter isn't executing the AJAX calls, and this can be fine depending on your site. Can you simply do an HTTP request to get the pages the AJAX calls populate?
I would recommend reading this post, as it looks pretty good.
I've seen that situation caused by a few things:
a page is required to load and be cached BEFORE making the failing request;
the failing page needs to automatically redirected to work properly;
the failing page has sub-requests JMeter failed to record. Devs can help with this.
Hope this helps.

Resources