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

Click() function isn’t working in protractor scripts

There might be multiple reasons for that and it is going to be a guessing game anyway. it could be that there is an another element matching the .login-button locator and you are clicking a different element. Let’s improve the locator: element(by.css(“.login-form .login-button”)).click(); wait for the element to be clickable: var EC = protractor.ExpectedConditions; element(by.model(‘credentials.username’)).sendKeys(‘RET02’); … Read more

In protractor, browser.isElementPresent vs element.isPresent vs element.isElementPresent

All function in a similar way with subtle differences. Here are few differences that i found – elm.isPresent() – Is an extension of ElementFinder and so waits for Angular to settle on page before executing any action. It works when elm is an element(locator) or ElementFinder and not ElementArrayFinder. If multiple elements are returned using … Read more

Testing AngularJS with Selenium

This will wait for page loads / jquery.ajax (if present) and $http calls, and any accompanying digest/render cycle, throw it in a utility function and wait away. /* C# Example var pageLoadWait = new WebDriverWait(WebDriver, TimeSpan.FromSeconds(timeout)); pageLoadWait.Until<bool>( (driver) => { return (bool)JS.ExecuteScript( @”*/ try { if (document.readyState !== ‘complete’) { return false; // Page not … Read more