I need to get the pagesource & then check whether the text "hello world" is absent in the pagesource.
I am trying the below method which is failing.
var page_source=browser.getPageSource().then(function (text){
expect(text).not.toContain("hello world");
});
Any suggestions ??
Error trace:
Stack:
Error: Failed expectation
at Object.<anonymous> (C:\Protractor\Testcases\test.js:56:38)
at C:\Protractor\node_modules\jasminewd2\index.js:110:25
at new ManagedPromise (C:\Protractor\node_modules\selenium-webdriver\lib\promise.js:1067:7)
at ControlFlow.promise (C:\Protractor\node_modules\selenium-webdriver\lib\promise.js:2396:12)
at schedulerExecute (C:\Protractor\node_modules\jasminewd2\index.js:95:18)
at TaskQueue.execute_ (C:\Protractor\node_modules\selenium-webdriver\lib\promise.js:2970:14)
at TaskQueue.executeNext_ (C:\Protractor\node_modules\selenium-webdriver\lib\promise.js:2953:27)
at asyncRun (C:\Protractor\node_modules\selenium-webdriver\lib\promise.js:2860:25)
at C:\Protractor\node_modules\selenium-webdriver\lib\promise.js:676:7
1 spec, 1 failure
Finished in 85.814 seconds
[18:02:43] I/launcher - 0 instance(s) of WebDriver still running
[18:02:43] I/launcher - internet explorerANY #01 failed 1 test(s)
[18:02:43] I/launcher - overall: 1 failed spec(s)
[18:02:43] E/launcher - Process exited with error code 1
Specs file:
specs: ['./Testcases/test.js'],