Timeout until the Transcavator syncs with the page after 11 seconds

I am new to Protractor (can only say 1 day) and tried to run the end to end test.

However, every time I run conf.js it displays me with "Timed out, waiting for the Protractor to sync with the page in 11 seconds."

Before posting this question, try all the options provided by other respondents, but are still unable to solve the problem and thus request your help.

For support, the following is information about my js js configurations and files:

Conf.js:

exports.config = { directConnect: true, capabilities: {'browserName': 'chrome'}, framework: 'jasmine', specs: ['example_spec.js'], jasmineNodeOpts: { defaultTimeoutInterval: 100000 } }; 

example_spec.js:

  describe('forfirm homepage', function() { it('login window should open', function() { browser.get('https://www.forfirm.com'); element(by.model('forfirm.email')).sendKeys(' email@email.com '); element(by.model('form.password')).sendKeys('Password'); }); }); 

The resulting conclusion:

  Failures: 1) forfirm homepage login window should open Message: Failed: Timed out waiting for Protractor to synchronize with the page after 11 seconds. Please see https://github.com/angular/protractor/blob/master/docs/faq.md. The following tasks were pending: - $timeout: function (){a.next(),h=f(j,5e3)} Stack: Error: Failed: Timed out waiting for Protractor to synchronize with the page after 11 seconds. Please see https://github.com/angular/protractor/blob/master/docs/faq.md. The following tasks were pending: - $timeout: function (){a.next(),h=f(j,5e3)} at /Users/rohitgathibandhe/npm-global/lib/node_modules/protractor/node_modules/jasminewd2/index.js:101:16 at Promise.invokeCallback_ (/Users/rohitgathibandhe/npm-global/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1329:14) at TaskQueue.execute_ (/Users/rohitgathibandhe/npm-global/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2790:14) at TaskQueue.executeNext_ (/Users/rohitgathibandhe/npm-global/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2773:21) 1 spec, 1 failure Finished in 22.022 seconds [launcher] 0 instance(s) of WebDriver still running [launcher] chrome #01 failed 1 test(s) [launcher] overall: 1 failed spec(s) [launcher] Process exited with error code 1 

Also, when running protractor conf.js, I could not see how the Chrome browser launch browser starts.

+5
source share
2 answers

You should take a look at Timeouts and try to install all of them first.

 allScriptsTimeout: 120000, getPageTimeout: 120000, jasmineNodeOpts: { defaultTimeoutInterval: 120000 }, 

Update: I hate to ignore synchronization, you should read about it, how to avoid it in the official documentation of the transporter - try the following:

conf.js

 exports.config = { directConnect: true, capabilities: {'browserName': 'chrome'}, framework: 'jasmine', specs: ['example_spec.js'], allScriptsTimeout: 120000, getPageTimeout: 120000, jasmineNodeOpts: { defaultTimeoutInterval: 120000 }, onPrepare: function () { browser.driver.manage().window().maximize(); }}; 

example_spec.js

 describe('forfirm homepage', function() { it('login window should open', function() { browser.ignoreSynchronization = true; browser.get('https://www.forfirm.com'); element(by.model('form.email')).sendKeys(' email@email.com '); element(by.model('form.password')).sendKeys('Password'); browser.sleep(5000); });}); 
+4
source

I believe that this should solve the problem, according to the official Protractor documentation at https://github.com/angular/protractor/blob/master/docs/timeouts.md ".

Interestingly, in our application, I see that it still takes 11 seconds by default, although I set the value of allScriptsTimeout to 120 seconds.

I also tried to do this in OnPrepare, despite the fact that I see the same time error as Protractor synchronizing with the page for 11 seconds. Any thoughts would be greatly appreciated.

Below is an example of my configuration (Node - 4.2.4, Transporter - 3.1.1)

 exports.config = { framework: 'jasmine', seleniumAddress: 'http://localhost:4444/wd/hub', specs: ['DemoTest.js'], getPageTimeout: 120000, allScriptsTimeout: 120000, capabilities: { browserName: 'chrome', }, onPrepare: function(){ browser.ignoreSynchronization = true; getPageTimeout: 120000; allScriptsTimeout: 120000; jasmine.DEFAULT_TIMEOUT_INTERVAL = 180000; }, } 
+3
source

Source: https://habr.com/ru/post/1246756/


All Articles