I have a web form I’m trying to enter info into. There are multiple INPUTs. If any of the entries are invalid, alerts appear as SPANs under whichever field is wrong.
A general selector that will find any of these elements is:
<webctrl aria-role='alert' tag='SPAN' />
When I use Check App State and use that as the selector, it doesn’t find the element if more than one is visible on the screen (ie more than one field has an entry error). It seems to me it should return true if any element is found matching the selector, but it only works if there is exactly ONE.
Will that be possible to link that to an anchor? If you have multiple input boxes and few are throwing error, then it would be better to add an anchor.
You’re not understanding. It works fine if there is only one error on the page. But if there is more than one that match the selector it doesn’t detect any of them, it goes to the “does not appear” branch. All I’m looking for is “is there one or more errors” but it only works if it’s ONE.
If there is ONE object on the page that matches, it works. If there are no objects on the page that match, it works. If there are two or more, it doesn’t work. With two or more, it acts like there are none.
It’s inside a Use App/Browser so it inherits the top level scope. None of that is the issue. The selector is correct. The issue is that it works if there are none, works if there is one, but when there is more than one it acts as if there are none. And this is not expected behavior.
Interesting use case. If I got it right, the Check App State was designed to find the state of one specific element, which might indeed prevent you from “batch” checking multiple errors at once.
But I might be wrong here, maybe it is a bug. I’ll tag @gheorghestan for more input
As we wait for more input, I got a small suggestion that enabling just the strict selector with the current selector could work as you expect. Could you please give it a try?
Yes we determined that this works. Fuzzy selector doesn’t work, regular selector does. Seems like both should work. Also, being able to explicitly define multiple selectors so Check App State can simultaneously look for multiple objects, would be great.