Reputation: 10722
I am running the following code (Java selenium client)- PAGE_NUMBER has a value, but I am unable to get it using selenium:
String script = "var cellValue = selenium.browserbot.getUserWindow().PAGE_NUMBER;";
selenium.runScript(script);
String value = selenium.getEval("selenium.browserbot.getUserWindow().cellValue;");
System.out.println("Value: " + value);
Upvotes: 0
Views: 1609
Reputation: 1082
I don't know Selenium 1 at all and Selenium2/Webdriver is very different. However there are three things that I suspect to play a role in this issue:
var
). You might try using a global variable by omitting the var
keyword, so that you can access it later.selenium.browserbot.getUserWindow().
. Try omitting this part.And then again, why not simply using
String value = selenium.getEval("selenium.browserbot.getUserWindow().PAGE_NUMBER");
?
I hope at least some part of this answer helps you. As I said I am just guessing.
Upvotes: 2