I am using the method executeScript
in selenium web driver, I found a problem:
js.executeScript("var b='1'; ");
js.executeScript("alert(b)");
After I run above code, I suppose get a alert window with value is 1
, but it says:
b is not defined
My question is: I defined b
as a global variable, but why I cannot get it in later?