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.
Method 1- for cucumber
Method 2- for cucumber
Using expected condition
browser.wait(EC.visibilityOf($(‘username’)));
Method 3- for jasmine
Use then to resolve and wait for subsequent step:
this.loginBtn.click().then(function(){
expect(element(by.xpath(‘//*[@id=”bAdd”]’)).getText()).toEqual(‘Create’);
})
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)
Want us to add
more code ?
more code ?