I am trying to store the value of browser.executeScript inside a local variable in my block, but I cannot do this in all cases when it displays zero.
I have tried many ways so far
browser.executeScript('$("#txtName").css("border-left-color");').then(function (color) {
console.log("This is color" + color);
});
Also this
function returnColor()
{
var a = browser.executeScript('$("#txtName").css("border-left-color");');
return a;
}
function getColorCode()
{
var a = returnColor().then(function(list){
console.log("Output is ***************" + list);
return list;
});
return a;
}
I use this inside my specification as
iit('', function() {
browser.executeScript('$("#txtName").css("border-left-color");').then(function (color) {
console.log("This is color" + color);
});
returnColor();
});
Will it really be receptive, can someone tell me how to do it right?
source
share