CodeceptJS icon indicating copy to clipboard operation
CodeceptJS copied to clipboard

CodeceptJS / Playwright / Getting intemittent 'go to' undefined issue on I.amOnPage(...)

Open rcamongol1 opened this issue 3 years ago • 5 comments

What are you trying to achieve?

We're trying to understand what's causing the intermittent issue where we are getting 'undefined'

What do you get instead?

We’ve been having a intermittent issue where we are getting ‘go to undefined’ when calling ‘I.amOnPage(’/’)’ Does anyone has an idea how to resolve this? Appreciate the help in advance.

NOTE:

  1. We are running in parallel using 5 bamboo agents but 1 browser instance each.
  2. That ‘loginToDashboard’ custom function and used by all of our scripts.

image

loginToDashboard: function (username, password) {
      this.amOnPage('/');
      this.login(username, password);
    },
Feature('Sample')

Before(async ({ I }) => {
    I.loginToDashboard(Login.Email, Login.Password);
});

Details

  • CodeceptJS version: 3.2
  • NodeJS Version: v14.17.3
  • Operating System: Windows 10
  • Playwright
  • Configuration file: image

rcamongol1 avatar Feb 07 '22 23:02 rcamongol1

It can implicitly mean that the instance of browser fails to start. goto just happens to be the first command on the browser, so it can seem not obvious what is happening. I have had the same issue, a CI agent in my case happened not to have enough memory and killed the browser. You should investigate/monitor resources consumption of the host where you run the test at the times of the failure.

jancorvus avatar Feb 09 '22 09:02 jancorvus

It can implicitly mean that the instance of browser fails to start. goto just happens to be the first command on the browser, so it can seem not obvious what is happening. I have had the same issue, a CI agent in my case happened not to have enough memory and killed the browser. You should investigate/monitor resources consumption of the host where you run the test at the times of the failure.

Thank you Jan, We also noticed resources consumption when running parallel test (Multiple browser instance) in the server, it reached almost 90% CPU usage. We decided to move back into (1) single browser instance so we don't consume that much resources but still the same, intermittently getting this issue.

Is there anything else we can do about it or any known workaround? Appreciate the help.

rcamongol1 avatar Feb 10 '22 00:02 rcamongol1

Another case when my browser was failing to start with that error was when I passed bad params to the browser. I was preparing a plugin to Chrome that sometimes got malformed and went to Chrome corrupted, so Chrome could not accept it and failed to start. Do you do any preparations of that kind?

jancorvus avatar Feb 10 '22 19:02 jancorvus

Another case when my browser was failing to start with that error was when I passed bad params to the browser. I was preparing a plugin to Chrome that sometimes got malformed and went to Chrome corrupted, so Chrome could not accept it and failed to start. Do you do any preparations of that kind?

Hmm, No, I don't think we have that special setup we pass before launching the browser aside from this argument :( image

rcamongol1 avatar Feb 10 '22 22:02 rcamongol1

Hi someone here can help me out please, why we're getting this intermittent 'go to' issue when calling I.amOnPage(...) function...

rcamongol1 avatar Mar 21 '22 22:03 rcamongol1

Closed for now! Feel free to reopen if you still encounter the issue with latest version and would be nice to provide a sample code to reproduce the issue.

kobenguyent avatar Oct 23 '23 07:10 kobenguyent