You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Selenium Users
(Using WebDriver/Java)
I have looked all over this forum and the internet to find the code to
get the current frame with no success. I must be doing something very
wrong. My application uses different frames and I'm spending so much
time trying to, at list get a list of existing frames.
If there's no way to get the current frame (weird), is there a way to
get a list of all frames and query the list for the frames that are
currently visible and active?
thanks!
Kevin O.
unread,
Oct 10, 2011, 1:19:01 PM10/10/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Selenium Users
For iframes you can do something like this to get a list of iframes
driver.switchTo().defaultContent(); // switch to the "main" page
List<WebElement> iframes = driver.findElements(By.tagName, "iframe");
Not sure how to figure out which frame is currently receiving
commands.
carina0110
unread,
Oct 11, 2011, 11:38:31 AM10/11/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Selenium Users
I did try that before but I would still like to know what is the
current active frame. I must be the only one needing to know where I
am. Thanks, though.
> > thanks!- Hide quoted text -
>
> - Show quoted text -
Pavithra
unread,
Oct 11, 2011, 12:58:11 PM10/11/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Selenium Users
If you can identify the frame as an webelement; may be you can use
element.getattribute(name) to identify the name of the iframe.
nargileh1
unread,
Sep 15, 2015, 8:49:17 AM9/15/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Selenium Users
1. grab the element by executing this javascript "return window.frameElement"
2. then do a "switch_to.parent_frame"
(since the frame-name is specified outside the frame itself)
3. then a get_attribute('name') on the element we grabbed in step 1 yields the name
Op dinsdag 11 oktober 2011 18:58:11 UTC+2 schreef Pavithra:
Jim Evans
unread,
Sep 15, 2015, 10:54:01 AM9/15/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Selenium Users
The API design requires you to be aware of what you've done and what state you expect your application to be in. Accordingly, since somewhere in your code you called switchTo().frame() to navigate into a frame, it's expected that you'll know which frame you switched into.
There *may* be approached that use frameElement or similar in JavaScript, but these will utterly fail (and rightly so) in a cross-domain scenario.