Is there a way to ...

36 views
Skip to first unread message

VAMSI DADI

unread,
May 4, 2016, 7:06:25 AM5/4/16
to Selenium Users
Hi,

I have multiple frames in my page. I am not sure in which frame I might have an element X.
But, I need to switch to a frame which contains an element X and perform an operation on it.
Is there any way I can directly switch to that Frame based on the element property like id or name? 


Regards,
Vamsi

Panikera Raj

unread,
May 4, 2016, 7:08:39 AM5/4/16
to selenium-users

I don't think so.

You have to traverse via every frame then you can access element or object.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/ebc3e175-8c5f-4d9a-a662-284092793809%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

pranab singh

unread,
May 4, 2016, 8:28:02 AM5/4/16
to seleniu...@googlegroups.com

You can't do that until you switch to the particular frame where element X is present...
Just create a loop saying that if the elements.size()==0, then switch to different frame... Hope this helps

Regards
Pranab Chetri

Andreas Tolfsen

unread,
May 5, 2016, 7:23:26 AM5/5/16
to seleniu...@googlegroups.com
You may be able to call into a frame’s document object model if it is a
child of the parent document using JavaScript, but it will not be
possible for WebDriver to _interact_ with any element from that frame
before you switch to it.

This is because WebDriver operates modally on the current browsing
context.
Reply all
Reply to author
Forward
0 new messages