I want to do this in selenium:
var variable = editors;
if (typeof(variable) == "undefined") {};
but I am not entirely sure how to do it with the getEval() method.
views:
45answers:
1
+2
A:
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';");
AutomatedTester
2010-09-06 21:01:21
ok... hmm... do you know how you would do that with browsermob? because I have never seen browserbot before.
chromedude
2010-09-06 22:01:11
I have updated my answer
AutomatedTester
2010-09-07 07:48:45