protractor
protractor copied to clipboard
string manipulation via browser.executeScript fails
hi.
In my test i want to do a check in which it needs to make an url change .for this i need the data from a string ,Only one problem the string ends with a space.
I tried multiple things like
Number = document.getElementsByClassName("grid_3 overflow-hidden ng-binding")[40].innerText.slice(0,14);
and :
Number.replace(/\s/g, "");
then i tried to run this code in just an javascript file and it worked
Is protractor maybe blocking string manipulation or do i need to add something so that it workes in protractor?
Edit : this code is activated by browser.executeScript()
Fixed
.slice(0,14); needed to be .slice(0,13); (i started counting at 1 instead of 0)
it works now ,weird thing is i still dont know why it then worked in normal javascript file but thats ok
sorry for this issue i made a dumb mistake