0

I've integrated Enterprise reCAPTCHA v3 with my HTML and JavaScript contact form. To ensure its effectiveness, I'm attempting to automate testing with Selenium to verify if the reCAPTCHA accurately identifies bots. However, after submitting 100 contact forms, the reCAPTCHA consistently returns a score of 0.9, indicating that it's likely a human interaction. This outcome seems unexpected and contrary to the intended functionality.

What could be causing this discrepancy? Has anyone encountered a similar issue with Enterprise reCAPTCHA v3 and Selenium automation? Any insights or suggestions on how to troubleshoot and resolve this problem would be greatly appreciated.

function onClick(e) {
    e.preventDefault(); // Prevents the default form submission behavior
    const captchaTokens = document.querySelectorAll(".form__recaptcha");
    for (let captchaToken = 0; captchaToken < captchaTokens.length; captchaToken++) {
        const element = captchaTokens[captchaToken];
        grecaptcha.enterprise.ready(async () => { // Ensures the reCAPTCHA library is fully loaded
          const token = await grecaptcha.enterprise.execute('6Le-Ia0p********NLj***LTVR******bJC1uF', {action: 'Testing__contact_form'}); // Executes reCAPTCHA with a specific action ('Testing__contact_form')
          element.value = token;
        //   MY FETCH CALL RUN HERE
        });
        
    }
  }
onClick(event)

This is my frontend code, I expecting 0.0 to 0.3 when selenium automation hit the contact form

0