1

I am trying to fill a form on an html page that I believe is contained within a frame. The relevant portion of the html looks like this:

<frameset rows="*" cols="*,183" frameborder="NO" border="0" framespacing="0">
<frameset rows="61,28,*,0,0" cols="*" frameborder="NO" border="0" framespacing="0">
<frame src="fr1_tab1.jhtml?NUM1=1462489510565" scrolling="NO" noresize name="frame1" title="page header - navigation">
<frame src="fr4_top.jhtml?NUM1=1462489510565" scrolling="NO" noresize name="frame1b" title="page header - search">
<frame name="frame4" title="main body" src="processShowMyPeapodPage2.jhtml?NUM1=1462489510565" noresize scrolling="AUTO">
<frame src="frame6.jhtml" marginwidth="0" marginheight="0" name="frame6" noresize frameborder="NO" border="0" title="empty">
<frame src="frame8.jhtml" marginwidth="0" marginheight="0" name="frame8" noresize frameborder="NO" border="0" title="empty">
</frameset>

The relevant information that I am looking for is located inside of frame1b. Using Selenium, I've confirmed that frame1b is indeed located on the page:

<code>
for thing in driver.find_elements_by_tag_name('frame'):
    print thing.get_attribute('name')
</code>

which outputs:

frame1
frame1b
frame4
frame6
frame8
frame2

frame3

cancelFrame

frame5


frame6

So after all of this, I try to use driver.switch_to_frame('frame1b'), but I get the error NoSuchFrameException: Message: no such frame.

My question is, how can I get into this frame, or if it is not necessary to get into this frame to access one of it's forms, how can I directly access the form?

2
  • good to have screenshot after inspecting your frame or element from firebug Commented May 6, 2016 at 5:13
  • Is this a site from the 90's? I haven't seen these deprecated frames in so long... The best option here would be to switch to that frame with the switch_to_frame function Commented May 6, 2016 at 13:41

1 Answer 1

1

I could be wrong but as far as I know you can use driver.switch_to_frame(selector) only if selector is an element id. In your case try to use following:

driver.switch_to_frame(driver.find_element_by_xpath('//frame[@src="fr4_top.jhtml?NUM1=1462489510565"]'))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.