Wednesday, 31 May 2017

Unable to verify the element using protractor Chai

I tried to validate the element using the below format, but unable to execute.

chai declaration in SD:

var chai = require('chai');

var chaiAsPromised = require('chai-as-promised');

var expect = chai.expect;

chai.use(chaiAsPromised);

Element definition => searchResult : element(by.className('class_name'))

Code => (searchResult.isPresent()).should.equal(true); & error message => "Cannot read property 'equal' of undefined"

Code => expect(searchResult.isPresent()).toBe.equal(true); & error message => "Invalid Chai property: toBe. Did you mean \"to"

Code => expect(searchResult.isPresent()).to.equal(true); & error message => "expected { Object (flow_, stack_, ...) } to equal true"

could anyone help me to find the element.



via KAK

No comments:

Post a Comment