How can I write an if statement depends on an object's property value?

I have an object that has a property that changes, sometimes its property value is “0”, sometimes “1”. I need an extra step if this value is “0”, but go forward without extra step if this value is “1”.

1 Like

Hi Melinda,

I also encounter this scenario that everytime the page reloads, the attribute/property of an object changes (usually it changes the value of id). So, it is hard to locate that object but we can find another way to locate that.

May I know what property it is? is it Id? name? class?

May I know what property it is? is it Id? name? class?

We use this property, similar to the others.
It has only this two value, “0” or “1”.
This is like a menu, which I can open and I can see what other menu elements are below it, and close, than I can’t see the other elements. If the menu open, this property value is “1”, when the menu closed the property value is “0”.
When I run the test case, I don’t know if it is open or closed, so I want to check it, and if it is closed, I want to open, than go forward, if it is open, I can go forward.

So its like a dropdown list? Am I correct?

Can you provide the HTML code of it? I want to see how it looks


It is not public, sorry.