You can always check if the element is inside an iFrame. If it is, you can add select frame command, and then choose whether it is an index or relative frame