Closed Bug 1090272 Opened 10 years ago Closed 10 years ago

Attempting to switch to an invalid frame causes a server side error

Categories

(Remote Protocol :: Marionette, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla36

People

(Reporter: mdas, Assigned: davehunt)

Details

Attachments

(1 file)

If you do try to switch to an invalid index:

framesLength = marionette.execute_script("return window.frames.length")
marionette.switch_to_frame(framesLength)

or any number higher than framesLength, then the server will try to switch into that non-existing frame and will hit an exception:

W/GeckoConsole(  206): [JavaScript Error: "TypeError: curFrame is undefined" {file: "chrome://marionette/content/marionette-listener.js" line: 1778}]

We should instead detect that we don't have this number of frames and return an appropriate error.
Also errors out for invalid frame indices like -2
Comment on attachment 8512830 [details] [diff] [review]
Raise NoSuchFrameException when attempting to switch to a non-existant frame by index. v1.0

Review of attachment 8512830 [details] [diff] [review]:
-----------------------------------------------------------------

awesome, works well locally
Attachment #8512830 - Flags: review?(mdas) → review+
https://hg.mozilla.org/mozilla-central/rev/69d426d27d31
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Product: Testing → Remote Protocol
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: