Nesting Pause until a and if/then or Try/catch

I’m trying to automate some actions that needs to actively search for a pop-up inside a browser but I’m having trouble finding a solution. Here’s how I want the macro to work:

  • I type in some input
  • click the submit button
  • pauses the script until an image is found which will pop-up after clicking the submit button*(which sometimes lags, so it takes about at least 1 second to completely load the image)*
  • clicks on a checkbox
  • then I want it to wait and look for another image/window to show up before continuing, then when image is found
  • it will click on a button again
  • Then now, at this part, I want it to look for the second image or similar*(with very slight difference)* and perform a different/continue with the rest of the script IF the image found is NOT the same from the second image,
  • IF it’s the same/somewhat similar, it clicks 2 extra buttons from that pop-up UNTIL the new popped-up window disappears or until the browser loads up a new webpage.

Here’s a screenshot of what I have or where I’m at rinow.

From what I see in the screenshots, your idea is to bypass captchas using a KM macro. Your approach might not work because the web pages may contain javascript that is collecting mouse data to examine if the mouse is being moved by a human hand. Your macro doesn't seem to move the mouse in a human motion, so your approach may fail. You didn't say why your approach is currently failing. You should open your debugger and find out exactly which action your macro is failing at.

However I have previously uploaded a macro that actually moves the mouse exactly like a human does, by recording human motion. If your approach doesn't work, you may want to read my macro and adopt its techniques, so that your pointer moves exactly like a human's hand moves, which is more likely to pass the captcha.

If your image matching is failing, another approach is to use OCR, which is less finicky but can get the same ultimate result.

I tried it, after recording and I run the Mouse Test, it's just showing me all this random mouse movements and circles. its not doing what I recorded..



also...
im not actually bypassing the reCaptcha, I just want to automate the repeated clicks of clicking the "I'm not a Robot" and another button after clicking that "I'm not a Robot" box and I want it to automatically detect if there's an error after doing the clicks and will REDO the click where the error has popped up. Im still answering the captcha questions, selecting the images and whatever.. that's all. I just want to fix the part of that script because sometimes when it throws an error, it still continues with the script even though the recapatcha is still showing or I failed the captcha and it gives me another question to answer. how can I make KM detect that?

Aha! That means you didn't understand my macro. You ran the Mouse Test, which is just a demo to illustrate how it works. You need to read the documentation more carefully and then place the "Mouse Move subroutine" into your own macro with the appropriate values. If that's too much for you, then just don't use my macro.

Aha! Then you didn't understand my point, that the website you are on may contain Javascript that uses advanced code to make sure that the mouse is being moved by a hand, and not by a macro. This means you may have to learn the hard way, by creating a macro that clicks on the box and then trying to understand why you are not passing the test. If it comes to that, then you may want to learn how to use my macro, which is designed to pass captcha tests.

I may be misunderstanding this, lemme rephrase my question.. is it possible for KM to check if a captcha window changes or if it fails to move forward meaning to its next captcha window? if it can, how can I make it repeat its last action ff it detects the captcha fails to move forward? that's all I want to know..

or maybe if I put it this way, everybody will understand:

I want the macro to

  1. do some actions
  2. waits for the captcha to show up
  3. clicks on the box inside captcha
  4. waits for another window that will pop up
  5. click on a button inside that second pop up
  6. waits for the window to change, if window doesn't change
  7. repeats step 5 with an additional action until webpage changes
  8. when webpage changes, will continue with the rest of the script or the script below this captcha script.

captcha detecting my movements as a robot doesn't matter because no matter how I add pauses in between this clicks these windows will still pop up no matter what.

Is this site public, where we could try the routines you're trying to use, and see exactly how things are/are not working?

-rob.

No. sorry. any website that has a recaptcha should work if you want to test it out. anyways, nevermind ill just try to figure this one out.

Sure! You can check the box with KM. But as I've said three times, if the site contains Javascript that uses math to make sure it's a human moving the mouse, then the check will fail. In that case you will need to do something more sophisticated, such as using my macro which moves the mouse like a human.

There's nothing for me to test because I already know how and why your approach will fail. Here's why it will fail:

When you click the checkbox, the CAPTCHA system (like Google’s reCAPTCHA) checks for human-like interaction patterns before, during, and after the click. Some things it looks at:

  • Mouse movement: Did your cursor move naturally or in a straight line?
  • Click timing: Was the click instant or did you hover a bit?
  • Scroll behavior: Did you scroll the page like a human might before clicking?
  • Keyboard input: Have you been typing in a human way?
  • Browser fingerprints: Do you have common plugins, cookies, or time zones like a normal user?

All of this is used to build a profile of your interaction to determine if you’re likely a human or a bot.

KM macros are "bots" and therefore they will likely fail the test. This is what you are still not understanding. Specifically, notice the test that says, "Mouse movement: Did your cursor move naturally or in a straight line?" I can see from your macro that you are not moving the mouse in a human-like manner, so you are likely going to fail the captcha.

I am not asking for KM to bypass the captcha's checking process.. I just want to know if it can tell whether the captcha changed its frontmost window and/or check if the initial captcha window threw an error.. so it not about whether captcha will find out if a bot is doing all this movements.. because no matter what, this website will throw the captcha to you as soon as you click the submit button. now after that, I was just wondering if KM could detect for any changes in the browser frontmost window. I don't think captcha running JS matters too because from my screenshot, it works up until the 3rd IF [1st Pause until image found works, 1st IF image is found works, 2nd and 3rd IF as well] the 4th IF is where im having trouble, it suppose to check if the 3rd check is still active, but its not, it just stop. or sometimes, continues with the rest of the script.

Yes -- screen shot the "before" window, wait for a bit, compare the current window to the screen shot. You'll have to play with the "fuzziness" of the match to find a balance between false positives and negatives, since even reloading a static page rarely gives a pixel-perfect match, and limiting the image detections to a specific area will help a lot.

No. sorry. there are different recaptchas so more specific information would help here.

It would help if you uploaded your actual macro rather than a partial screen shot (instructions at How to Post/Upload your Macros and Scripts) -- there is no fourth "If" in either your image or descriptions so it's a little difficult to tell where things are breaking.