0
votes

I have the JUNIT code in my eclipse

My workflow is as follows:

  1. Login to an Web Application
  2. Enter the userID and password.
  3. Create some User
  4. Log out

when i try to execute this script using the JMeter it could not succeeded.

MY JMeter does only launch the browser and get into my web application, after that it gets failed.

But my JUnit code works fine when execute using eclipse

Can some one help me in this?

1
If it fails then you should see the actual problem in log file. It maybe JavaScript or Ajax related problem, but not sure. - Bobur Meliev

1 Answers

0
votes

Make sure that the correct Classname/Test Method is selected in the JUnit Request Sampler.
Make sure errors are appended by checking the boxes as in the image below.
enter image description here
Use the fail() method to debug. Put it in your catch blocks or wherever needed.
If that seems too tedious to you then write your own mini logger (or use an existing one) and append all errors to a file. (Probably the best option).
Just throwing it out there: it is possible to use JOptionPane.showMessageDialog(null, e.toString()); to debug by adding the rt.jar from your jdk folder. This can get annoying though...

For setup or tutorial please see Jmeter Junit Issue