Hello,
I'm trying to get the CSS value without success by following the 
documentation for 
http://www.protractortest.org/#/api?view=webdriver.WebElement.prototype.getCssValue

it('test using getCssValue()', function(done) {
        var inputField = element(by.css("#searchBoxNew"));
        expect(inputField.getCssValue().indexOf("rgb(105, 105, 
105)")).to.eventually.not.equal(-1).notify(done);
});

result >>>> TypeError: inputField.getCssValue(...).indexOf is not a function

Am I not doing exactly the same as the example in the doc? I am not doing 
this on an angular page but a normal web page. Does that make any 
difference?

In comparison, here is what I have to go through to get the CSS:


it('test using computedStyle()', function(done) {
        var inputField = element(by.css("#searchBoxNew"));
        browser.executeScript(function (el) {
            return window.getComputedStyle(el).getPropertyValue('color');
        }, inputField.getWebElement()).then(function (color) {
            expect(color).to.equal("rgb(105, 105, 105)");
            done();
        });
});


I'm attaching a screenshot of my CSS.

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to