Script issue in J Meter while recording script using 'BAD BOY' tool - jmeter

Chrome Settings
HI All - I am new to J meter and i am continuously getting the script error while recording the script using bad boy tool.
I tried with the changing the chrome settings as above:
but still am getting the same script error.

I hope when you normal browse the application then your are not getting the error.
So, if you are recording and getting pop-up but you can proceed further then record your action and suppress the javascript error from Preference>Automatically handle>Javascript Error Dialogs.
You can also disable recording javascript request from Preferences>Recording option. Since, jmeter work on request and response and not GUI level so javascript is not supported. It does not actually parse/execute JavaScript coming with the loaded page.
Also, try the option you have shown to disable script in IE browser and then try with chrome.
Hope this helps.

Related

CanĀ“t open an internal page in Cypress Chrome

We have an cypress issue that is similar to the issue described in "https://github.com/cypress-io/cypress/issues/850". The reason for why I am creating a new post is that I have done some changes in the environment which makes this work but only after the first fail and then manually click on the failing URL.
Test1:
Default cypress\plugins\index.js file (no changes)
lauch the internal page cy.visit('xxx')
Error 401.
Click on the link below the error text. Another tab is opened and message UNAUTHORIZED is shown.
Paste same URL in default Chrome->works fine.
Test2:
Modify the cypress\plugins\index.js: args.push('--proxy-pac-url=xxx') (I have tested other arguments but this is the only one that makes something different)
Lauch the internal page cy.visit('xxx')
Error 403.
Click on the link below the error text. Another tab is opened and the page is shown CORRECTLY.
This is the reason why I post this new message. I want to ask if there is a way to get Cypress to open the page automatically via cy.visit() in the same way as when I click on the failing URL and it opens the page in the same cypress browser but just another tab?

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.

Jmeter - error message "500/unexpected alert open"

I can't close an alert with Jmeter on my website.
Jmeter return me the following message : "500/unexpected alert open".
I tried a lot of methods and I investigated a lot on internet, but I haven't found a solution :(
please, help...
JMeter is not a browser, as such it doesn't interpret client javascript as Selenium does it.
So you need to understand what Javascript does in terms of request(s) going to server and reproduce this with HTTP Request
Finally I have found a solution to my problem with the following command :
WDS.browser.executeScript('window.onbeforeunload = null;')

AJAX not getting invoked through QTP

I am working on QTP 11. I my current project I am trying to automate a website with AJAX fields. I my project I have a text field on which if we try to enter characters then AJAX table appears and we have select a suitable value from the below table. I am able to check the existence of AJAX table.
The problem is to set the text field through QTP, AJAX is not getting invoked. But manually it is working properly. Also, if I first try manually and then I try to enter any through the script, then also it is working properly. It is not possible for me to check each field manually then enter it through script. So can any body tell how AJAX can be invoked on first try without any manual intervention?
I have tried to Set property, Keyboard events like WScript.shell, Mercury.DeviceReplay and AutoIt, however none of them are working. Are there any keyboard input methods that I have missed out?
Can somebody please help me out?
Try performing a WebEdit.Click on the text field in question. If this doesn't work it means that the web page is expecting some events that QTP didn't fire in this case you should change to device replay mode
Setting.WebPackage("ReplayType") = 2
Browser(...).Page(...).WebEdit(...).Click
Setting.WebPackage("ReplayType") = 1
I had the same issue, not recognizing the web list (not selecting the item from list). Using QTP 11.5 loaded with web toolkit 2.0, ASPAjax, DOJO, JQuery add-ins. Still showing the same behavior.
However there is nothing wrong with the code, if I give some wait the code is working OK.

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