description
select a frame to test the components in it
===================================================================================
DO NOT USE THIS EXTENSION: instead use the standard selectFrame method which is now included in standard selenium.
===================================================================================
- target:the name of frame to test
example of use
| selectFrame |
frameName |
|
| click |
buttonInFrame |
|
......
other actions in the frame
......
selectFrame(null) means returning control back to myiframe
notes
- Don't set the attribute "target" of form in frame to "_Top".This will replace selenium with AUT."_Parent" maybe what you need.
- Because of my limitation in ability, I had to change two core files of selenium,selenium-browserbot.js and selenium-executionloop.js.
- For supplying the function to view dom tree of frame, I made some changed in TestRunner.html.
- Thanks alexandre Garel for the command "include".Very nice job!
- Because of using "include" in my tests,please put selenium under some server before running them.
download
selectFrame v1_1 for 0.6
selectFrame v1_1 for the latest src
intoduction about the modifications of the core files
- selenium-browserbot.js
- In function BrowserBot.prototype.modifySeparateTestWindowToDetectPageLoads,I add some code which adds onload listener to the frame to select in function BrowserBot.prototype.callOnFramePageTransition which is in user-extensions.js.So all "ActionAndWait" in frame become work.
-
- In function KonquerorBrowserBot.prototype.pollForLoad ,I add "try...catch..." around the line "var sameDoc = (originalDocument ===
windowObject.document);".The reason is because "permission denied" alert was always jumping out when the page was changing in selected frame.When I chose not to debug the error,selenium worked fine.I thought when the page was changing,we couldn't access the document of previous page which had been changed.I don't know how to work around it So I add "try...catch..."
- selenium-executionloop.js
- I add the expression "if (!this.waitForCondition)return;" in pollUntilConditionIsTrue because waitForCondition maybe null when the current window is frame.