How to resolve Common errors in Protractor

How to resolve Common errors in Protractor

    When you are trying to setup your testing too, there is a chance that you will be stuck on some error and it will consume some of your valuable time.

While working with protractor, there is aoo% chance that you will stumble upon this error which the most common error with this tool.

There are multiple ways to try that can fix this issue.

Failed: Error while waiting for Protractor to sync with the page: “both angularJS testability and angular testability are undefined. This could be either because this is a non-angular page or because your test involves client-side navigation, which can interfere with Protractor’s bootstrapping. See http://git.io/v4gXM for details

        <h6>Method 1- for cucumber</h6>     
        <h6>Method 2- for cucumber</h6>     
    Using expected condition<pre dir="ltr">browser.wait(EC.visibilityOf($(‘username’)));</pre>      
        <h6>Method 3- for jasmine</h6>      
    <p>Use <strong style="font-size: 16px;">then</strong> to resolve and wait for subsequent step:</p><pre dir="ltr">this.loginBtn.click().then(function(){      <br />     expect(element(by.xpath(‘//*[@id=”bAdd”]’)).getText()).toEqual(‘Create’);<br />})</pre>     
        <h6>Another Jasmine Error-

Error: Timeout – Async callback was not invoked within timeout specified

In jasmine, async call is triggered and time out happens. To solve it, give enough time in it block for example 12000ms in blow code

it (‘some thing’, function(){
}, 120000)

[hfe_template id=’1966′]

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.