The existence of the IE element

I need to check if the robot has opened the required page or if the login page has opened. To do this, I suspect, you can check for the presence of some element.

A similar issue was discussed in this topic:

But I can’t figure out how to assign an element to a variable and then verify its existence. What should I write in the Elements field and what type of variable will it be?

I use IE

  • In the Get Element, set the MinResults to 0.
  • In the Elements property, type the text “results” and then press Ctrl+K to auto-create a variable with the name “results” of the correct type.
  • Under/after the Get Element, add an If activity and check if results.length (or maybe it’s results.count) is 0 …

This way, you can do something if the element was found (in the body of the Get Element) and something else if the element was not found (inside the body of the If activity)

1 Like

Thank you, Allan! Helped me out, as always!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.