We are trying to build a jmeter testcase which does the following:
Where we are facing issues is because there is a captcha while logging into the system. What we had planned to do was to download the captcha link and display, and wait for user to type in the value. Once done, everything goes as usual.
We couldnt find any plugin that can do the same? Other than writing our own plugin, is there any option here?
CAPTCHA is an acronym which means Completely Automated Public Turing Test To Tell Computers and Humans Apart so it means you won't be able to handle it using JMeter.
Disable the security feature: You can ask the developer to disable the security feature like Captcha or OTP of the application for testing purpose only. In that case, you do not need to include the request/function which handles captcha or OTP. But such an approach bypasses the security code (logic) of the application.
CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart) is a type of security measure known as challenge-response authentication.
What is JMeter? Apache JMeter is an open source Java application designed to load test functional behavior and gauge software performance. Originally designed for testing web apps, it has since expanded to include other test-related functions.
I was able to solve it myself. The solution is as follows:
In it, the following code displays the captcha and waits for user input
filenameOrURL = new URL("${captchaimage}");
image = Toolkit.getDefaultToolkit().getImage(filenameOrURL);
Icon icon = new javax.swing.ImageIcon(image);
JOptionPane pane = new JOptionPane("Enter Captcha", 0, 0, null);
String captcha = pane.showInputDialog(null, "Captcha", "Captcha", 0, icon, null, null);
Then we can use the captcha variable in any way we want. Thank you everyone who tried to help.
Since CAPTHA used to detect non-humans, JMeter will always fail it.
You have to make a workaround in your software: either disable captcha requesting or print somewhere on page correct captcha. Of course, only for JMeter tests.
Dirty workaround? Print the captcha value in alt image for the tests. And then you can retrieve the value and go on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With