How can I wait for a condition?

Protractor 1.7.0 has also introduced a new feature: Expected Conditions. There are several predefined conditions to explicitly wait for. In case you want to wait for an element to become present: var EC = protractor.ExpectedConditions; var e = element(by.id(‘xyz’)); browser.wait(EC.presenceOf(e), 10000); expect(e.isPresent()).toBeTruthy(); See also: Expected conditions in protractor

Protractor console log

getText and most other Protractor methods return promises. You want to put your console.log statement inside the promise resolution: Using the new Protractor syntax: element(by.id(‘view-container’)).getText().then(function(text) { console.log(text); });

Protractor: element.getText() returns an object and not String

getText() returns a promise, you need to resolve it: page.clientRowName.getText().then(function (text) { console.log(text); }); Or, if you just want to assert the text, let expect() resolve the promise for you: expect(page.clientRowName.getText()).toEqual(“ABC”); Promises and the Control Flow documentation page should clear things up.

Can protractor be made to run slowly?

Below is my solution to do that. So basically I created a decorator for current control flow execute function, which now additionaly queues a delay of 100ms before each queued action. This needs to be run before any tests are invoked (outside describe block) var origFn = browser.driver.controlFlow().execute; browser.driver.controlFlow().execute = function() { var args = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)