Selenium Exception : "return not in a function" Selenium Exception : "return not in a function" selenium selenium

Selenium Exception : "return not in a function"


From the selenium documentation for GetEval:

Gets the result of evaluating the specified JavaScript snippet. The snippet may have multiple lines, but only the result of the last line will be returned.

Therefore you simply need to leave off the return:

string code = selenium.GetEval(   "var win = this.browserbot.getUserWindow(); "+   "win.editAreaLoader.GetValue(win.loadedCodeEditorID);");