I’m trying to develop a regression test for a website that has to interact with a number of elements that can be hidden, depending on settings the customer specifies. These elements (often times input or button elements) aren’t hidden themselves but rather wrapped around numerous div elements that have a parent somewhere above it in the DOM that’s hidden. UiPath studio doesn’t recognize these elements as hidden. Instead, it will go to the nearest input or button that’s NOT hidden (which is NOT the element I’m trying to click/type into) and click/type into it.
The work-around for this I’ve found is to use a Find Element activity before the click/type into activity and check the check-box for WaitVisible. The issue with this is that when the element is off-screen (such as several pages above/below), the Find Element activity times out until you scroll up to where the element is, in cases when it’s NOT hidden. This page has a variable length and can be any number of pages or clicks away from where the viewport the bot is actually viewing.
You can refer to the below post to get more clarifiy on different types of click\Types which you can perform. Better to try with Simulate Click or Send windows message. If its not working for you then, you use a loop and loop should continue until Element exists and scroll down and if found then use a break to exit out of the loop. This way you can avoid the errors.
Wait Active: Makes the Find Element activity time out regardless of if it’s on the screen or not.
Wait Visible: Causes Find Element activity to time out if the element is off screen.
Element Exists: Finds element even if it’s hidden
SendWindowMessages: Doesn’t fail when it needs to fail. It just skips right over it and continues.
SimulateClick: Doesn’t fail when it needs to fail and actually causes the logic of the button click to fire as if it wasn’t hidden
I would prefer not to have to create a loop to find each control that I need to interact with b/c I have about 100 controls that I need to do so.
These elements have “display: none;” in the style. Coming from a web developer background, the fact that Element Exists doesn’t adhere to this or at least has a checkbox that toggles it seems absurd.
Using element exists or a check for each and every element will not make sense if there is an absolute requirement on that or you have the appropriate scenario
You can please go with simulate input method or others to make it work and whenever you have an issue please let us know.