Studio 2024.10.8 - breakpoints cause selectors to fail

I have a sequence of activities - Check App State, Get Text, then a Click. If I let them run straight through (in Debug) everything works fine. If I put a breakpoint on one of them, then when it pauses and I click Continue, it fails to find the UI element. I’ve tested it a few times, adding/removing the breakpoint then running in Debug mode…and it’s consistent. Every time I put a breakpoint on one of these activities it fails to find the UI element.

Could it be changing the state of the application you interact with Paul?

I’ve seen it before, I think mostly of Java type things, when the window not being in focus actually changes all the selectors and so a break point, switching the focus, causes this behaviour.

I suppose that’s possible, but I’m not sure how I would determine that. It seems like anything I do to look at selectors would have the window focused, so how would I find out if things are changing when it’s not the active window? It’s a fairly simple web based app, no Java nor anything like that.

Just guessing here:

Could it be that:

  • the breakpoint and continue force a refresh of the scope, and the window selector in the click activity is not matching the parent scope selector? That somehow the window object is destroyed and reacquired below the surface?
  • Hardware clicks that require app to be in the foreground, where the break disrupts that? In this case you could for workaround purposes add an extra activate activity before the click. I know you’re not looking for workarounds, but just thinking out loud.
  • I’m sure I’ll find a valid 3rd guess at some point…

Yeah, its a good question. I use the Ui Explorer for such situations because you are able to make your selector, change the focus and use the validate function in it to see if the selector is still valid.

I believe with that you should be able to re-create the situtation I am guessing it to be to confirm if thats the case or not.
If you do this please share the results, however if the focus makes no difference I am not sure what next to suggest to be honest.

Doing it with UI Explorer it still validates, and highlights, even without the browser window being the focused window. Thinking about it more, this is the same as going to Studio and clicking Edit for the activity, it finds it and highlights just fine. This all leads me back to thinking it’s a problem with Studio where pausing on the breakpoint is interrupting something and then it doesn’t properly find the element.

Thats super weird then.

My only suggestion to get further insights is to get the element onto a variable (I tend to use Highlight for this), then add a break point and try to use it again, logging the elements current selector along the way (not sure if the selector indeed changes as it goes if it is mutating)