I want to do this in sele开发者_开发问答nium:
var variable = editors;
if (typeof(variable) == "undefined") {};
but I am not entirely sure how to do it with the getEval() method.
Since you have not mentioned where editors is coming from I am going to assume that it is on the page. var win = this.browserbot.getUserWindow();
will give you access to window.
selenium.getEval("var win = this.browserbot.getUserWindow();var variable = win.editors; typeof ( variable) === 'undefined';");
****Edit from comment****
browserbot is the JavaScript object that Selenium uses to control the internals of the browser. It is the object that controls the window. What you can do in Selenium you can do in BrowserMob. So go into the advanced scripting of your script and then put
var resultFromEval = selenium.getEval("var win = this.browserbot.getUserWindow();var variable = win.editors; typeof ( variable) === 'undefined';");
精彩评论