Search code examples
pythoniframeseleniumselenium-rc

selenium test not selecting inner frame


I have a selenium test that I am trying to get up and running but one problem is that it has to select a frame and is failing at it.

the html looks like this

<iframe src="#" name="mainframe" id="mainframe" />

and the python test uses the command

sel.select_frame("mainframe")

and when I run the test I get an output like this

sel.select_frame("mainframe") File "/usr/lib/python2.4/site-packages/selenium/selenium/selenium.py", line 901, in select_frame self.do_command("selectFrame", [locator,]) File "/usr/lib/python2.4/site-packages/selenium/selenium/selenium.py", line 217, in do_command raise Exception, data Exception: ERROR: Element mainframe not found


Solution

  • Thanks for the input I did not verify that the above solution works but the problem was related to the script executing a function before it had logged into the application