Search the Element

Hi
I need to search an element from the url page and it must be visible. Searching element could be found by passing id which is fetched by using JS. If I use find element- it will throw error if element is not visible.
My requirement- Bot need to search the element if not visible scroll down/up

Any suggestions

@KarthikBallary

You can use Get Attribute and select Visibility

Place a if condition based on the result

OR

you can use Set Focus activity too

If element found then it will auto focus

Hope this helps you

Thanks

Set Focus is not making visible and it don’t have any output

@KarthikBallary

SetFocus will not make visible, but youcan use Get attribute, Visibility, If you get visible result then make setfocus to avoid scroll

Hope this helps you

Thanks

  1. Use "For Each Activity in it write “Enumerable.Range(1,1000)” inside it’s body.
  2. Use “Find Element Activity” to find required element, in it’s Output put a variable e.g. ‘Finding_Element’.
  3. Use “If Condition” and give “Finding_Element=False”
  4. In “Then” Put “Click Activity” and Click on Arrow below scroll bar,
  5. In “Else” Put “Break Activity”

This will solve your problem.

1 Like