42

Is it possible to set some flag in my browser so that I always get the RECAPTHCA image challenges? Sometimes when you click on the "I am not a robot" button, it gives you a pop up challenge with something like "Click all the images which contain a car", but sometimes it just checks off the box and takes your word for the fact that you're not a robot.

I would like to test the UI of my tool both on a desktop and on mobile, and make sure that the challenge pop up shows up and interacts well with other elements of the page.

In other words, as a developer, I want Google to think that I'm a robot so that it always gives me the visual challenge.

Is there any way to force this behavior?

Note: I've done some research and was unable to find any relevant questions or blog posts that might yield an answer.

Jake
  • 3,142
  • 4
  • 30
  • 48
  • 2
    A bit late, but have you tried to test in an anonymous window? Whenever I access through an anonymous window it asks me to do the challenge. – Lucas Basquerotto Apr 26 '19 at 16:20
  • 2
    I find it baffling that Google doesn't offer this option as an input flag to the `grecaptcha.execute()` method (or something). Pretty frustrating – Brian FitzGerald Apr 06 '20 at 14:13
  • @LucasBasquerotto Thank you! A private/incognito window is the only thing here that has worked for me. – Luc May 30 '22 at 04:19
  • Same problems here. Only way I can get it to fire is after doing everything here, turns out I submitted my own form 20+times, lol, which looks sus enough that the ReCapcha started firing. (im dealing with a form in a popup that the ReCapcha does not display over top of correctly) - We should not have to do any of this. I am surprised Google has not added some simple solution like patching site.com/#fireReCapcha into the url to trigger it. I've fired that off to the Google ReCapcha support dept and ref this Stack. (maybe we could all do that?) – Christian Žagarskas Mar 09 '23 at 03:05

7 Answers7

24

The methods told here should generally work, but there is no guarantee of the same. There is a very easy way to guarantee that Google reCAPTCHA challenge always show up. All you need to do is to add a custom BOT device in developer tools and then use the same to test.

  1. In Chrome Dev Tools, open Settings. Open Devices after that.
  2. Add a custom device with any name and set User Agent String to Googlebot/2.1
  3. Finally, in Device Mode, at the left of the top bar, choose the custom device that you created (the default is Responsive).

Thanks to the SO users who had put it up in the answer and follow-up comment here.

thisisashwani
  • 1,748
  • 2
  • 18
  • 25
  • 1
    I tried all of the suggestions on this page so far and this was the first that worked for me on Google Chrome on Mac, V85 as a user. Thank you! – Kreidol Oct 07 '20 at 23:34
  • 1
    Worked perfectly! – Dan H Nov 05 '20 at 22:08
  • 5
    Not working in 2021. `ReCaptcha v3 will still let the google bot pass as it has a score of 0.9 when emulating in Chrome.` – Oleg Frolov Apr 12 '21 at 14:27
  • 1
    This solution doesn't prevent captcha from passing. It causes the challenge to show up, so that you can test that it can trigger at all. Did you mean that it no longer triggers the challenge for you in v3? – Kreidol Jul 09 '21 at 23:28
  • 1
    Adding Google crawler documentation: https://developers.google.com/search/docs/advanced/crawling/overview-google-crawlers – Kreidol Jul 09 '21 at 23:36
  • @OlegFrolov, as Kreidol mentioned, the steps I mentioned helps the challenge to show up deterministically. Is the challenge not showing up for you? I will also try it from my end and cross-check once :) – thisisashwani Jul 12 '21 at 07:30
  • @thisisashwani the problem was with the recaptcha v3 itself: it doesn't show any challenge at all. You can use recaptcha v2 invisible instead, and you can get same invisible as v3, but with additional challenge modal (in some cases) – Oleg Frolov Jul 12 '21 at 13:49
  • 2
    I got this working by using user agent `Googlebot/2.1 (+http://www.google.com/bot.html)`. `Googlebot/2.1` by itself isn't actually on the [Google crawler list](https://developers.google.com/search/docs/advanced/crawling/overview-google-crawlers) that @Kreidol linked to. – adam-p Oct 26 '21 at 14:56
  • None of this is working as of 2023... I am surprised Google has not added some simple solution like patching site.com/#fireReCapcha into the url to trigger it. I've fired that off to the Google ReCapcha support dept and ref this Stack. (maybe we could all do that?) – Christian Žagarskas Mar 09 '23 at 03:03
  • @ChristianŽagarskas That is because hacker can trigger these things, trying to convince google that is a user who is testing it and allow certain activity. I guess they have a test key in Enterprise edition which might work. – Akash Kava Apr 12 '23 at 05:30
18

I too have been looking for similar functionality. While I have not found a code-based solution to force the challenge, I have found a fairly reliable hack.

Grab a VPN tool (I happen to use IP Vanish), then connect to a remote server (I've had success connecting to China). Then, open up a private/incognito window and fill out your form.

From my testing, the combination of the remote IP and the blank user session triggers the challenge.

7

Here are a few things you can try. In my experience all of them will increase your chances of getting a challenge.

  1. Log in at https://www.google.com/recaptcha/admin and edit your reCAPTCHA settings. Under Security Preference choose Most Secure.
  2. Use a VPN + incognito mode (as suggested here)
  3. If you're using the invisible reCAPTCHA, I found that using explicit rendering + immediately calling grecaptcha.execute() after grecaptcha.render() will usually trigger the challenge. I suspect this is because Google's AI expects a user interaction of some kind to trigger grecaptcha.execute() and not the onloadCallback itself.
PHP Guru
  • 1,301
  • 11
  • 20
  • Hi I am using google recaptcha invisible type. I have called grecaptcha.execute() after grecaptcha.render() which is happening after ajax response. but when I render again it give me error that "recaptcha element already exist". Could you please help me solving this – KV90 May 29 '20 at 14:08
  • 1
    We should not have to do this. I am surprised Google has not added some simple solution like patching site.com/#fireReCapcha into the url to trigger it. I've fired that off to the Google ReCapcha support dept and ref this Stack. (maybe we could all do that?) – Christian Žagarskas Mar 09 '23 at 03:04
  • Security Preference options don't even exist in the admin console anymore as of this posting. There are surprisingly few options. – Longblog May 22 '23 at 22:36
2

2022 and later

It seems to be increasingly harder to trigger the recaptcha challenge of the invisible recaptcha. Using the UserAgent of a bot, going into incognito mode is not enough anymore. A VPN might work, but I do not trust free VPN services.

I am however still able to trigger the recaptcha challenge when I'm only using the keyboard while filling in the form fields and pressing the submit button with the enter key. It seems like the Google Recaptcha is now also following your mouse movements to determine if you are a real user. Make sure to never hover your mouse cursor over the webpage and only use the keyboard.

Wezelkrozum
  • 831
  • 5
  • 15
  • 1
    Only using the keyboard got it work for me (along with https://stackoverflow.com/questions/43397678/is-it-possible-to-force-fail-a-recaptcha-v2-for-testing-purposes-i-e-pretend, incognito, and the highest security setting) thanks for the advice! – Conner Leverett Mar 16 '23 at 15:31
0

I use reCAPTCHA's SDK in Android, and I also encounter the need to force validation when testing. I tried it many times. At last, I turned off or turned on the flight mode, which can be verified in the retest. I guess it may be that Google put my IP on the white list in the background, so I passed the verification without any challenge.

sindi.chen
  • 41
  • 1
0

That should be possible, because when LinkedIn forcefully logged out an user for excessive usage, it showed captcha on next login, and there always was the challenge.

Unfortunately, LinkedIn switched from Recaptcha to another provider just few days ago, so I cannot just look up into their JavaScript code. It is what makes me believe that Recaptcha does have an undocumented option to force the challenge.

-1

I was looking for something like this and after some research plus trial & error what worked for me is to use the invisible recaptcha and invoke the challenge with JS.

After you have loaded the recaptcha script on your page then do

grecaptcha.execute()

and the challenge might be invoked.

  • 9
    I don't think this is true. The .execute function will indeed cause the invisible recaptcha to evaluate and obtain a token, but it is still out of your hands whether that generates a visual challenge. I can confirm because I am using this method and it does not generate a challenge -- at least not any more often than normal (reloading the challenge many times will usually generate one). I wonder if maybe after so many times of initializing recaptcha in a row that you simply started getting receiving the challenges as a coincidence? – Matt Nov 29 '18 at 21:18
  • I just called this function until I got a challenge. – Rafał Cieślak Jun 24 '19 at 14:33
  • this doesn't work, it gives about the same probability of showing the challenge as clicking the checkbox recaptcha. – Russell Chisholm Nov 22 '19 at 17:51
  • I haven't tried this again in a long time. Based on your answers I guess it's not working anymore. I remember that back in the day I did et the results I was expecting.... – Felipe Ignacio Noriega Alcaraz Nov 26 '19 at 17:24