Check App State activity in transition's trigger (State Machine Workflow)

Hello there. I have a very frustrating problem with the State Machine Workflow.
The idea of the workflow is basic :
initial state => Does a Google Search
After that process multiple ‘state’ can occur : Captcha, No result or Succes result.
Between those states I of course set for each of them transitions, in which a Chek App State looks ui elements that describes a Captcha, No Result, or Success result situation.
BUT, for a unknown reason, the Check App state for the Captcha transition sets the boolean to true when the element it was configured to look for doesn’t exist on the browser page ! and the problem is the same for the other transitions, when a google result exists, the transition No result will flag the boolean to true… leading to a complete overall random process. I’ve spent hours adding delays, checking that the descriptor is correct etc…
It’s really frustrating.

I have to notify that those check app state and the associated descriptor worked perfectly in a sequential manner, but not in state machine workfow which is really a shame.

Has anyone been through this mess ?

@lboudev

can you show some screesnhots of logs and activities…and use breakpoints and check the value in state machine transition and in normal sequence

we have such cases but dint see an issue as such

cheers

Hi @lboudev

Which property have you set for check app state? “On element appear” or “doesn’t appear”?

Can you share some screenshots of your workflow?

Also have you tried running in debug mode?

Hello thank you for answering Anil_G and sonalia.

Here’s a screenshot of the workflow :

Here is the “Check App State” activity in the “Trigger” section of the Capcha Transition :


And the UIelement it looks for :
Screenshot 2025-04-27 183207
Its a Strict Selector (no computer vision, nor anchor points) which is defined as followed :

"<webctrl name='*' tag='IFRAME' /><webctrl class='rc-anchor-logo-text' aaname='reCAPTCHA' innertext='reCAPTCHA' visibleinnertext='reCAPTCHA' />"

(I always try to define the most precise and dynamique descriptor)

And here is the configuration in the proprety panel (which is the same for every other “Check App State” activity in the other Transitions :

I always use the debug mode when developping and use breakpoints for debugging.
Here’s a perfect example of the problem I encounter :

1] The Search State inputs a search pattern in the google search bar :
site:linkedin.com/in ((“Continuous Improvement Consultant” OR “Consultant amélioration continue”) AND “AG2R” AND (“Île-de-France” OR “Paris”))
Here is the result of the page :


As you can see the there’s no result, which should lead to the NoResult Transition and direct the process the Final State. BUT, the Captcha Transition State was triggered as true, as you can see in the logs :

Then the process tries to tick the ReCaptcha box via I “Click” activity, which of course doesnt exists because it hasn’t really appeared.

I must again assure you that the process works in a sequential flow.
I’ve spent time with ChatGpt about this. According to him, it’s because the captcha element is hidden in the DOM, that’s why the “Check App State” is triggering the isCaptcha boolean to true even if it’s not visible on the page. But this explanation seems dodgy. Why would Edge Google page hide a Captcha in it’s DOM ? Chaptgpt talked about ‘phantom’ elements that appeared precedently and remained in the futur pages load, but still this information is not satisfying as the browser in opened fresh and that no Captcha has been encountered yet in the process I’ve tested here and shown you the screenshots.
I’m realising that I’m maybe wasting a lot of time (and yours) on a problem that would be solved by sticking to the sequential workflow. BUT, I really wan’t to figure out the problem and to benefit the “parallele” processing of the State Machine Workflow to gain in speed and also code clarity.

Thank you for your help.

I think I’ve found the problem : I am using a browser instance as an input and not the uielement (btn, text etc.). I’ll change that and tell you if it worked.