I want to select the frame in the web page and it failed to select frame in Selenium IDE. And when I use the Webdriver, it comes an NoSuchFrameException
:
driver.find_element_by_name("GO").click()
driver.find_element_by_id("EO_PE_SRCH_INP_EO_PE_URLTEXT$5").click()
driver.switch_to.frame("contentFrame")
driver.switch_to.frame("contentFrame") File "/Library/Python/2.7/site-packages/selenium-2.44.0-py2.7.egg/selenium/webdriver/remote/switch_to.py", line 64, in frame self._driver.execute(Command.SWITCH_TO_FRAME, {'id': frame_reference}) File "/Library/Python/2.7/site-packages/selenium-2.44.0-py2.7.egg/selenium/webdriver/remote/webdriver.py", line 173, in execute self.error_handler.check_response(response) File "/Library/Python/2.7/site-packages/selenium-2.44.0-py2.7.egg/selenium/webdriver/remote/errorhandler.py", line 166, in check_response raise exception_class(message, screen, stacktrace) NoSuchFrameException: Message: Unable to locate frame: contentFrame Stacktrace: at FirefoxDriver.prototype.switchToFrame (file:///var/folders/nk/l6lw3w5917l99dl9vs0g6z_m0000gn/T/tmp4NI1ne/extensions/[email protected]/components/driver-component.js:9710:11) at DelayedCommand.prototype.executeInternal_/h (file:///var/folders/nk/l6lw3w5917l99dl9vs0g6z_m0000gn/T/tmp4NI1ne/extensions/[email protected]/components/command-processor.js:11635:16) at fxdriver.Timer.prototype.setTimeout/<.notify (file:///var/folders/nk/l6lw3w5917l99dl9vs0g6z_m0000gn/T/tmp4NI1ne/extensions/[email protected]/components/command-processor.js:548:5)
HTML code:
<head></head>
<frameset id="fm2" frameborder="0" cols="150,*" framespacing="0" border="0">
<frame src="https://xxxxxxxxxxx/servlet/Main/menu" scrolling="yes" name="mainMenuFrame"></frame>
<frame noresize="" name="contentFrame" src="https://xxxxx/servlet/Main/main?usertype=2">
#document
</frame>
</frameset>