yes, i use at work without problem. Very useful when you can add some specific logic. Compared to simple Macro application, this tool have advantage. And you can try another similar tool: Playwright
This is the best and practical demo I have seen so far. Is there a way to import form inputs from a JSON file to run through the form and then web scrapping the results?
I have a page i'm scraping that will resubmit the page after i click the button. The button stays on the page which causes an infinite loop of page submit. How do i prevent the loop? I just want to click the button once. Instead, it looks for the button, submits then sees the button again and keeps hitting it which causes infinite page reload. Please help if you can.
the best tutorial you nailed it , thank you so much, i had one clarification, i have seen that you are seeing constants in the password area but i didn't see that you are importing the constants, can you please guide me how to use constants when in case hardcoded values or user-id logins
Depends on your need. For basic automation (not testing), Puppeteer is a good option. I'd definitely go with WebdriverIO if testing is the goal though.
You can use either environment variables, or command-line parameters to do this. Check out npm packages like Yargs or Dashdash: www.npmjs.com/package/yargs www.npmjs.com/package/dashdash
I am interested about SPA apps, for example a React App, will puppeteer work just fine? especially wait for navigation? will components work fine. As you know with React there is no page loads. I am wondering if you already have a video about testing a fully SPA app. Thanks. This video was very helpful especially the three clicks part.
Puppeteer should still work there, but you may need to add some "wait" conditions to check on elements being loaded. If you're going to be writing tests, I'd recommend using a tool like WebdriverIO that has some of this built-in
I just found this video right now and saw your comment. Probably way too late for you (who knows? ^^), but maybe it could help others: If you don't have an id to work with you can go with any other CSS selector like you would with jQuery $('xxx') or element.getElementsBy...('xxx'). For instance if you have an input with a name attribute, let's say , you can do it with await page.type('input[name="first_name"]', "your value");
Hi Kevin great work if there is image captcha on login how to handle it Sometimes on login sometimes on submission page if we have image captcha then how to deal it Please provide solution Is there a way we can show the captach in a small window and write it and the whole thing automate when I submit it Or page by page it will show captcha and once I fill captcha rest thing it automates
Great question! Unfortunately I don't have a good answer. You could 'pause' you script and manually enter the OTP code, but I don't know of a way to fully automate it.
Thanks Kevin great video.. but before i get too far into the Puppetter.. I need to ask a question. Can the headless version of puppeter handle form submission with headless version. As i think of form submisson the normal way needing a display... and i can;t convert it to a post as the form has so much security it you tamper with the form in any way it quits.. and grabbing all the data and posting it direct would be so simple for them to detect.. so which ever headless package I settle on it must be headless and must be able to submit a full blown form without the usual display... I need to know this early on so while waiting for Kevin to respond it would be great if someone who knows could jump in.. Thanks in advance.
really good video. Would you build a robot on pancake swap using puppeteer?Is it possible to automate all the trading process like buying and selling coins
You can execute custom JS code that uses the Clipboard API to run copy/paste commands: developer.mozilla.org/en-US/docs/Web/API/Clipboard_API Not sure how to do this in Puppeteer off the top of my head.
Hey... unfortunately, that's not going to happen :) CAPTCHAs are purposefully made to avoid that sort of thing, so it's just not a simple task at all, and I don't have the CS degree to figure it out.
It depends on what you want to use it for. It you want to do Automated Testing, I highly suggest using WebdriverIO, which does have puppeteer support built-in so you get the best of both worlds. If you want to use it just to automate some process, then yeah, learning puppeteer is definitely worth it IMO
That's a really tough one. The whole point of recaptcha is to prevent automation, so you're going to have an extremely tough time trying to write automated code to get around it. I'd recommend two approaches: 1. Create a specific test server that has a workaround to captcha, either disabling it or providing an alternative 2. Pausing your test when the captcha step occurs and manually entering it, then unpausing to continue
@@frontendtesting Can you please help me out with this issue. stackoverflow.com/questions/57017108/puppeteer-isnt-working-with-lazy-loaded-images-even-after-scrolling-from-npm-p
Yeah, Puppeteer is a bit noisy for a full-scale web testing, too much typing and the scripts tend to be too long, which makes is difficult to navigate if you come to it after some time.
@@frontendtesting I actually had a try over the weekend, just for fun and learning purposes. And it wasn't as bad as expected. I mean it probably takes a bit longer to type it all, but the tests are really stable and fast, so it will probably pay off later if they are used on a regular basis. Cypress is fine, but I can't stop thinking whether or not it's so pupular just because their good marketing... when I see the number of basic questions on Stackoverflow or elsewhere, it makes me wonder why people pick a tool they can't handle or work with effectively.
@@silentexploration Yeah, Cypress definitely has some hype to it. But I also think the founders are really smart folks and definitely looking at how to move the industry forward. We can certainly be skeptical, but also appreciate what Cypress introduces to a bunch of folks who wouldn't be interested otherwise.