Come for answers, stay for best practices. All we're missing is you.
Forum question posted -
HI.
Is there a way to query if you are on say the list tab or not for example?
Is it as simple as scripting a way to handle findelement failures?
thanks for any examples
Jeff
For something like the list page, you can check whether a filter field (or a button in the table) exists using elementExists. If it does, you are on the List tab.
{"event":"makeVariable","elementExists":"element_id_to_check", "params":["parameter_name"]},
The other way you can do it is if you are on a tab itself, you can check the class of the tab. If the classname is text tablabel on, you are on the tab. If it's text tablabel off, you are not on the tab.
Unfortunately when you are on the list page, there is no tab so the same can't be used there.
The elementExists event returns a boolean value so you can then use that value to do something. For example, if you're not on the tab, click it, etc.
Hopefully one of these helps!
Kristin