Looking to access global variables using JavaScript with WebDriver.
Here is my code snippet:
this.Then(/^I read global var$/, function (selectedElement) {
fetchGlobalVar(window.location.href);
});
function fetchGlobalVar(varName){
return varName;
}
Error Message: ReferenceError: window is not defined