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.
<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′]