How to getText on an input in protractor

This is answered in the Protractor FAQ: https://github.com/angular/protractor/blob/master/docs/faq.md#the-result-of-gettext-from-an-input-element-is-always-empty The result of getText from an input element is always empty This is a webdriver quirk. and elements always have empty getText values. Instead, try: element.getAttribute(‘value’) As for question 2, yes, you should be able to use a fully qualified name for by.binding. I suspect that your … Read more

How to debug timed out waiting for asynchronous Angular tasks? Failure to find elements on angular page occurring

In the following I list a set of potential causes and possibilities to fix/resolve them. How does AngularJS and Angular(2) Work / What can I check in the Browser Dev Mode I can’t explain it as well as Andrey Agibalov in his Blog here, so check it out (also for developers). Basically, the objects required … Read more

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

Timed out waiting for asynchronous script result while executing protractor scripts with appium

1. Regarding with route check In case after first spec, user got logged in and the route changed. Make sure all are navigated before any test executed. expect(browser.getCurrentUrl()).toContain(‘#/the_route_of_logged_in’); // ‘#/’ is just illustration. You can remove it to make it shorter // => like this …toContain(‘the_route_of_logged_in’); 2. Regarding with click on tutorial browser.wait(EC.elementToBeClickable(tutorial), 10000); Do … Read more

Take elements while a condition evaluates to true (extending ElementArrayFinder)

Maybe I’m missing something, but couldn’t you just go through ul li a elements while they gave you something from getText(), and store them to some array, or do something with them directly in that loop? var i = 0; var el = element.all(by.css(‘ul li a’)); var tableItems = []; (function loop() { el.get(i).getText().then(function(text){ if(text){ … Read more