protractor icon indicating copy to clipboard operation
protractor copied to clipboard

browser.executeScript errors

Open Basman01 opened this issue 12 years ago • 1 comments

Hi,

in my test i have a piece of code that the browser.executeScript executes but there are some errors with it that i cant fix

this is the browser.executeScript code : browser.executeScript('var allcookies = document.cookie;cookiearray = allcookies.split(";");for(var i=0; i<cookiearray.length; i++){name = cookiearray[i].split("=")[0];value = cookiearray[i].split("=")[1];console.log("Key is : " + name + " and Value is : " + value);}sidValue = value;console.log(value);console.log(sidValue);receiptNumber = $scope.row.nr;window.location.href("https://www.mysite.nl/info?sid="+ sidValue +"&filter={nr:"+ receiptNumber + "}");');

i have two problems :

  1. $scope.row.nr ,it says that $scope is not defined.
  2. on my window.location.href it saysProperty 'href' of object [object Location] is not a function (when i remove href it says the same only about location).

Does anybody knows how to fix this?

Basman01 avatar Dec 09 '13 15:12 Basman01

This seems like a good question for StackOverflow. Please ask it there, so we can keep github issues clean for bug reports and feature requests!

juliemr avatar Dec 09 '13 21:12 juliemr