Open KomalAgarwal1 opened 1 year ago
@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.
@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?
@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?
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?
@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?
@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
@JacksonGL No the script is still not working, it gives the same error as shown in screenshot.
Please see detailed logging below:
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
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
@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?
@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
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.
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?
Also, the browser version is same from both memlab and puppeteer(stand alone)
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>
@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
@KomalAgarwal1 looks like you are building on Windows, please build with Git Bash
@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
Ideally the page should have looked like this:
@KomalAgarwal1 That's strange.
I would recommend a few things to try:
defaultUserAgent
to null
. In that case MemLab will use Chromium's default userAgent.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.@KomalAgarwal1 That's strange.
I would recommend a few things to try:
- Set
defaultUserAgent
tonull
. In that case MemLab will use Chromium's default userAgent.- 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.
@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
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 :
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
ormemlab <COMMAND> -h
to get helper text interaction fail