Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser is not supported error #32

Open
KomalAgarwal1 opened this issue Sep 22, 2022 · 20 comments
Open

Browser is not supported error #32

KomalAgarwal1 opened this issue Sep 22, 2022 · 20 comments

Comments

@KomalAgarwal1
Copy link

KomalAgarwal1 commented Sep 22, 2022

Hi Team,

I am getting unsupported browser issue during initial launch, while trying to run memlab on an application. (Ran the script in headful mode).
Observed the same script is working in Puppeteer(stand alone version) for the same chromium version.
Chrome Version is 101.0.4950.0

Tried using below code in setup function but it did'nt help:
async function setup() {
const browser = await puppeteer.launch({ product: "firefox" });
const page = await browser.newPage();
}

Can you please confirm if there is any way to select a different browser via some code in script or in runtime while executing using CLI?

Below is the screenshot of error :
image

Error on console:
page-load(baseline)[s1] > action-on-page(target)[s2] > revert(final)[s3]
interaction fail, making 2 more attempt(s)...
interaction fail, making 1 more attempt(s)...
Use memlab help or memlab <COMMAND> -h to get helper text
interaction fail

@JacksonGL
Copy link
Member

@KomalAgarwal1 MemLab doesn't support Firefox for now. The setup callback has a page parameter, please use that instead of creating your own, otherwise MemLab cannot navigate through the page or take heap snapshots.

@KomalAgarwal1
Copy link
Author

KomalAgarwal1 commented Sep 22, 2022

@JacksonGL I have tried with page parameter also, but its giving the same error.
Is there any other way I can use to navigate the application?

@JacksonGL
Copy link
Member

@KomalAgarwal1 Can you share the scenario file (with the page parameter)?

Observed the same script is working in Puppeteer(stand alone version) for the same chromium version.

What kind of chromium + Puppeteer (besides stand alone version) are you using?

@KomalAgarwal1
Copy link
Author

Hi @JacksonGL
PFA script for your reference.
testfile.txt

Can you please elaborate on below?
What kind of chromium + Puppeteer (besides stand alone version) are you using?

@JacksonGL
Copy link
Member

@KomalAgarwal1 earlier you mentioned:

Observed the same script is working in Puppeteer(stand alone version) for the same chromium version.
Chrome Version is 101.0.4950.0

So I was asking which puppeteer + chromium version you are using that is not working for the script?

@JacksonGL
Copy link
Member

@KomalAgarwal1 Also thanks for sharing the script, I see it no longer contains the await puppeteer.launch({ product: "firefox" }); statement. Is it working right now? Or do you still get the some errors?

Tip: when the memlab run fails, rerun memlab with -v to get more debug information

@KomalAgarwal1
Copy link
Author

KomalAgarwal1 commented Sep 23, 2022

@JacksonGL No the script is still not working, it gives the same error as shown in screenshot.

Please see detailed logging below:

Xvfb supports: false
Xvfb: false
{
"_browserVersion": "Chrome/101.0.4950.0",
"_puppeteerConfig": {
"headless": false,
"devtools": false,
"ignoreHTTPSErrors": true,
"ignoreDefaultArgs": [
"--disable-extensions"
],
"args": [
"--no-sandbox",
"--disable-notifications",
"--use-fake-ui-for-media-stream",
"--use-fake-device-for-media-stream",
"--js-flags="--no-move-object-start"",
"--enable-precise-memory-info",
"browser-test"
],
"defaultViewport": {
"width": 1680,
"height": 1080,
"deviceScaleFactor": 1
}
},
"_consoleMessages": []
}
Browser version: Chrome/101.0.4950.0
Node.js version: v16.17.0
Start tracking JS heap
Fri Sep 23 2022 21:48:21 GMT+0530 (India Standard Time)
[1/3] visiting page-load (baseline)
page-load(baseline)[s1] > action-on-page(target)[s2] > revert(final)[s3]
url: https://hostportalperf.cbrehost.com/login
loading: https://hostportalperf.cbrehost.com/login
URL changed:
Expected: https://hostportalperf.cbrehost.com/login

Actual: https://hostportalperf.cbrehost.com/browserError.html

Error: No node found for selector: [id=onetrust-accept-btn-handler]
at assert ()
at DOMWorld.click ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async setup ()
interaction fail

@KomalAgarwal1
Copy link
Author

I was asking which puppeteer + chromium version you are using that is not working for the script?

Puppeteer version: 13.7.0
Chrome version: 101.0.4950.0

@JacksonGL
Copy link
Member

JacksonGL commented Sep 23, 2022

@KomalAgarwal1 Can you share the full error message? (including the interaction fail, making 1 more attempt(s)... part)

I was asking which puppeteer + chromium version you are using that is not working for the script?
Puppeteer version: 13.7.0
Chrome version: 101.0.4950.0

If I understand correctly, you had a standalone puppeteer script (without MemLab) that did the same interactions, and it worked. Is that right?

@KomalAgarwal1
Copy link
Author

@JacksonGL The one I have shared in above comment is the complete error message.

If I understand correctly, you had a standalone puppeteer script (without MemLab) that did the same interactions, and it worked. Is that right?
Correct

@JacksonGL
Copy link
Member

JacksonGL commented Sep 23, 2022

Ah ok, I thought the error message was incomplete because of the line separator.

This part is interesting:

Expected: https://hostportalperf.cbrehost.com/login
Actual: https://hostportalperf.cbrehost.com/browserError.html

I guess https://hostportalperf.cbrehost.com has some sort of user agent checking for the browser vendor and version.

@KomalAgarwal1
Copy link
Author

Ah ok, I thought the error message was incomplete because of the line separator.

This part is interesting:

Expected: https://hostportalperf.cbrehost.com/login
Actual: https://hostportalperf.cbrehost.com/browserError.html

I guess https://hostportalperf.cbrehost.com has some sort of user agent checking for the browser vendor and version.

If that is the case, Is there a way using which I can pass the user-agent from memlab script?

@KomalAgarwal1
Copy link
Author

Also, the browser version is same from both memlab and puppeteer(stand alone)

@JacksonGL
Copy link
Member

JacksonGL commented Sep 23, 2022

yeah I know, memlab sets a default user agent string here:
https://github.com/facebookincubator/memlab/blob/main/packages/core/src/lib/Constant.ts#L21

For now, there is no option to set the user agent in MemLab CLI (we can add one).

To verify the theory about user agent checking, you can check out memlab git repo, change the user agent in the link above, build with npm install && npm run build and run with the build from Git repo:

node ./packages/memlab/bin/memlab run --scenario <YOUR SCENARIO FILE>

@KomalAgarwal1
Copy link
Author

@JacksonGL
Tried the same steps as you suggested.
Changed defauft user agent as below in constant.ts file:

defaultUserAgent:
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 " +
"(KHTML, like Gecko) Chrome/ 105.0.0.0 Safari / 537.36",

I am getting error in build step. Attaching the error log for the same

error.txt

@JacksonGL
Copy link
Member

JacksonGL commented Sep 23, 2022

@KomalAgarwal1 looks like you are building on Windows, please build with Git Bash

@KomalAgarwal1
Copy link
Author

@JacksonGL
After changing defaultUserAgent to "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" and running npm build in git bash. It is able to launch the app but partially.

Actual behavior of app: This page generates a login page and gives option to enter user details but this isn't loading properly.
Please have a look below:

Log details :
logging.txt

image

Ideally the page should have looked like this:
image

@JacksonGL
Copy link
Member

@KomalAgarwal1 That's strange.

I would recommend a few things to try:

  1. Set defaultUserAgent to null. In that case MemLab will use Chromium's default userAgent.
  2. When you run memlab run command also add the --debug and --headful option, which will pause execution after every step so that you can use Chromium's DevTools to see what happens in the browser page.

facebook-github-bot pushed a commit that referenced this issue Sep 26, 2022
Differential Revision: D39777353

fbshipit-source-id: 49c359142822746fd842e0a4d0d75991e66eb9ba
@KomalAgarwal1
Copy link
Author

@KomalAgarwal1 That's strange.

I would recommend a few things to try:

  1. Set defaultUserAgent to null. In that case MemLab will use Chromium's default userAgent.
  2. When you run memlab run command also add the --debug and --headful option, which will pause execution after every step so that you can use Chromium's DevTools to see what happens in the browser page.

@JacksonGL These steps didn't helped much because I see the same behavior of the application. It is not loading the Email and Login area.

@JacksonGL
Copy link
Member

@KomalAgarwal1 Here are all the puppeteer configs in MemLab, you can start by removing all of the configs and add them back one by one and see which puppeteer config doesn't work with the site under test:

https://github.com/facebook/memlab/blob/main/packages/core/src/lib/Config.ts#L270

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants