Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

If Puppeteer captures the login page instead of the dashboard, first check whether the browser is authenticated and whether the screenshot waits for the dashboard to finish loading. A resolved navigation does not prove that login succeeded: inspect the final URL and response, verify a dashboard-only element, and capture only after that check passes. The exact cause depends on the target site’s session rules and your script.

Why Puppeteer captures the login page

A screenshot records what is rendered at capture time. Seeing a login page usually means one of three things: the browser did not have a valid session, the site redirected the dashboard request to login, or the dashboard had not rendered when the screenshot was taken. These causes can overlap, so verify authentication and page readiness separately.

  • Missing or invalid session: the login and screenshot steps may be using different browser contexts or profiles, or the session may have expired or been rejected.
  • Redirect: the dashboard URL may send unauthenticated visitors to the login route.
  • Timing: navigation may have completed while the application is still rendering or fetching dashboard data.
  • Unfinished intercepted request: if request interception is enabled, a handler may leave an authentication, script, or API request unresolved.

Diagnose the final page before changing the login code

  1. Record safe diagnostics. Log the requested URL, final page.url(), navigation response status, redirect chain where available, and whether a known login or dashboard selector is present. Do not log passwords, session-cookie values, or authorization headers.
  2. Check the browser context and profile. Confirm that login and capture use the same BrowserContext and browser profile. A fresh context or process does not automatically inherit another run’s login state.
  3. Inspect the destination and response. Check whether navigation ended at a login URL and what the final page rendered. Puppeteer’s Page.goto() resolves with the main-resource response; in a redirect chain, that is the response for the last redirect, not proof that the application authenticated you. See the Page.goto() API.
  4. Assert an application-specific signal. Wait for a selector that appears only on the dashboard. If it times out, report the final URL and check whether the login selector or dashboard selector is present.
  5. Take the screenshot only after the assertion passes. This makes a failed login or missing dashboard element an explicit error instead of a misleading image.
  6. Audit interception, if enabled. Inspect every handler for requests to login endpoints, redirects, scripts, and APIs. Each intercepted request must be resolved exactly once.

Choose how the browser should retain or obtain login state

There is no universally correct strategy without knowing the site’s authentication policy. Choose based on session expiry, SSO or MFA behavior, CI isolation, secret handling, and whether the test is meant to exercise login itself.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Approach When to consider it Trade-offs
Reuse a persistent profile with userDataDir Repeated runs in a controlled environment where retaining a browser profile is permitted. Convenient, but the directory must be writable and profile access, expiry, and CI isolation need care. Persisting a profile does not keep an expired or rejected session valid. See Puppeteer troubleshooting.
Restore valid cookies into the active context Tests that intentionally use a valid test session and can protect the session secrets. Requires explicit setup; cookie domain, path, expiry, and context matter, and cookies may not represent all application state. The Puppeteer cookies guide is marked “Next,” so confirm API names against your installed version.
Run the supported login flow for each run Short-lived sessions, extra login checks, or tests that need to cover authentication. More steps and synchronization, but it exercises the actual flow. The site’s login policy and automation requirements are application-specific.

For a persistent profile, Puppeteer’s LaunchOptions.userDataDir selects the user data directory; a temporary profile is normally created when you do not provide one. For restored cookies, use only a valid session you are authorized to use, store secrets securely, and verify that the site accepts the resulting session. Cookie APIs provide storage operations, not a guarantee that a particular site’s session is valid. See the cookies guide.

#1 Best Overall
Sale
Diccik 1080P Webcam with Microphone, Full HD Web Camera for Desktop Computer and Laptop USB Computer Camera for PC Pro Streaming Webcam for Zoom/Skype/Teams, Plug and Play PC for Windows &Mac
  • Vivid Full HD 1080P Video Quality: Experience crisp, professional video with the DICCIK 1080p webcam. Delivering 1920 x 1080 resolution at a fluid 30fps, this web camera ensures clear images for every online calling session. Whether you are streaming or recording, it is a reliable computer camera that outperforms standard laptop cameras.
  • Integrated Microphone for Clear Audio: This pc webcam features a built-in noise-reducing mic. Designed as a computer camera with microphone for desktop, it captures your voice naturally while filtering background noise. Perfect for busy home offices, ensuring you are heard loud and clear on Zoom, Skype, and FaceTime.
  • Instant Plug and Play USB Connection: No software or drivers required. Our usb webcam is a true plug and play solution for your PC or Mac. Simply connect the camera for pc to your USB port, and it’s ready in seconds. The flexible clip makes it an easy-to-install monitor camera or desktop camera.
  • Automatic Light Correction for Dim Lighting:Look your best even in low-light environments. This computer camera for desktop automatically adjusts brightness and white balance to match your room's light. From bright offices to dim bedrooms, this streaming webcam ensures a professional look without extra ring lights.
  • Wide Compatibility for Work and Play:A versatile pc camera webcam that works seamlessly with Windows 7/10/11, macOS, and Linux. This webcam for mac and webcam for laptop is fully optimized for Microsoft Teams, Google Meet, and YouTube. An essential camera for computer users across all major operating systems.

Use an application-level readiness check in code

Replace the example URL and selectors with values for your application. The example assumes your authorized login flow has already run in the same page and context, or that the active context has been given valid state. The dashboard selector must be stable and exclusive to the authenticated dashboard.

const requestedUrl = 'https://example.com/dashboard';
const dashboardSelector = '[data-testid="dashboard"]';
const loginSelector = '[data-testid="login-form"]';

try {
  const response = await page.goto(requestedUrl, {
    waitUntil: 'domcontentloaded',
    timeout: 30_000,
  });

  console.log({
    requestedUrl,
    finalUrl: page.url(),
    status: response?.status() ?? null,
  });

  try {
    await page.waitForSelector(dashboardSelector, { timeout: 15_000 });
  } catch (error) {
    const loginVisible = await page.$(loginSelector) !== null;
    throw new Error(
      `Dashboard did not become ready. finalUrl=${page.url()} ` +
      `loginSelectorPresent=${loginVisible}`
    );
  }

  await page.screenshot({ path: 'dashboard.png', fullPage: true });
} catch (error) {
  console.error('Dashboard capture failed:', error.message);
  throw error;
}

domcontentloaded is a navigation milestone, not proof that the dashboard is ready. The selector wait is the application-level check. Puppeteer’s screenshot guide demonstrates waiting for an element before capture; it also supports taking a screenshot of a selected element with ElementHandle.screenshot(). See Puppeteer screenshots and Page.waitForSelector().

Rank #2
PC Motherboard and PSU Power Supply Tester Diagnostic Analyzer Starter Kit
  • 【1】*** MUST see the 3rd pictures in listing that highlights the correct PCI slots to work ***. Using this kit wrongly on motherboard other PCIe port is not the reason of "Doesn't Work". Please make sure the motherboard has PCI slot before placing the order. The Large Desktop PC motherboard diagnostic card is NOT a PCIe card but a Standard PCI card. If the PC has PCIe express slots only, please see my other listing with the "V8 PCIe Diagnostic Kit" instead. ***DO NOT push the Wrong pins with excess force to avoid issue. MUST MAKE SURE PSU 4 / 6 / 8 pin power connector pins match and fit to the tester exact same 4, 6, 8 pins CORRECTLY although the PSU tester is fault tolerant and preventive.
  • 【2】This starter kit comes with 1 large PCI test board and 1 small laptop test board for the old desktop PCs and old laptops diagnosis respectively. The large test board comes with【BIOS SPEAKER】to get the desktop PC motherboard Bios beep codes. The 【motherboard power switch cable】is nice to quick check the sticky or damaged PC motherboard power switch button and cable causing no power ON issue. The【the Anti Static Wrist Strap】is a plus to help discharge static during the PC repairs. The 【ATX PSU tester】in this kit is either Blue or Black Color with EXACT same features to quick test the 20/24 pins PC ATX PSUs.
  • 【3】Nice starter kit for old computers no Power On / Auto Power OFF / no POST / no Display / no Boot ...etc. diagnosis. No need to swap Known Good Parts in the computer repairs. Save time and money!! All parts are packed well and stored neatly in a nice 【Portable Carrying Storage Case】. A overall great starter kit to add to our tool boxes! Great for computer class learning and old PCs quick troubleshooting needs as well.
  • 【4】Please see the listing for the instruction PDFs. *****【On the listing page】, scroll down to after the "Product Information" table the "Product guides and documents" section, BOTH the pictorial "User Guide (PDF)" and the "User Manual (PDF)" are needed. *****. ***** Besides, please DO NOT discard the ITEM PACKING Included Paper Manual Note Printout since that also contains the complete Instruction folder info!!! *****
  • 【5】Online Easy Guide and Pictorial Manuals to guide step by step with complete list of codes description. Downloadable manuals to stay updated. Welcome to conact if any question or need helps. Quality Genuine Computer Hardware Diagnostic Test Starter Kit with Free Lifetime Customer Service Supports from 29 years professional computer hardware work experienced seller.

If you need redirect details, attach a response listener before navigation and record only safe fields such as response URL and status for the relevant main-frame navigation. Avoid dumping request headers or cookies into logs. The final page.url() is a simple first check for a redirect to a login route.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Authentication details that commonly cause confusion

Use the same context or deliberately restore state

Cookies and other browser state belong to a browser context/profile. Logging in in one context and opening the dashboard in another can produce a login page even in the same browser process. Puppeteer provides browser-cookie APIs and corresponding BrowserContext methods; check that the state is present in the active context and has the expected scope and validity.

Rank #3
Wide Angle Webcam, 120 Degree Large View, Spedal 920 Pro Conference Camera
  • BEST TEAM MEETING WEBCAM: 920Pro 120°FOV wide angle webcam specifically designed for boardroom meetings, telecommuting, or multi-person chats. Great for business video meetings in conference rooms. Built-in noise-canceling microphone specifically optimized for ultra-clear conversations in huddle rooms. The webcam for pc rotates 360 degrees for versatile positioning, and the manual focus lets you fine-tune pictures
  • New Upgraded Flexible Gimbal Base: This webcam for pc captures complete panoramic scenes in bright 1080p High-Definition with zero blind spots. Web cam with 120 wide-angle advanced glass lens combined with 360 horizontal & 180 vertical rotation range create a complete 720 coverage
  • PLUG & PLAY: Easy to use. easy to install web camera for desktop computer. Plug the power and USB, load up your favorite video conferencing platform, and start your meeting. No downloads or installs. Tripod-ready universal clip fits all! kinds of laptops, LCD, or monitors. Works well with most video applications: Xbox, OBS, XSplit, FaceTime, Hangouts, BlueJeans, Zoom, Skype, lifesize., Vidyo, Broadsoft. Google Talk, Nimbuzz, Line, Tango, Viber, Imo, Facebook.TokBox, WeChat, etc
  • EXCELLENT IMAGE QUALITY: Stream and record vibrant, full high video and image definition 1080p webcam for pc with Full HD 8-layer coating lens will capture and provide crystal clear images. Optimized for professional-quality video calling, conferencing, recording and streaming on social gaming and entertainment sites. This pc webcam 1080p can stram at 30/frames per second, which delivers remarkably crisp. clear and detailed images in vibrant colors
  • AUTOMATIC LOW LIGHT CORRECTION & MANUAL FOCUS DESIGN: Automatic low light correction makes you see clearly even in dim light. The live streaming webcam with beauty effect to perfectly preserve the facial details and makes your skin immaculately in an instant The full HD webcam has a manual focus on an area up to 10M

Persistent profile does not mean permanent login

A userDataDir can preserve browser profile data between launches when configured appropriately, but the site may expire, revoke, or reject a session. Persistent storage also has operational implications: protect the directory, avoid sharing it between concurrent jobs, and make sure CI can write to it.

Page.authenticate() is not a web-app login shortcut

Page.authenticate() supplies credentials for HTTP authentication. It is not a generic mechanism for signing into an application’s HTML login form or restoring its ordinary web session. Puppeteer’s API notes that it enables request interception behind the scenes; see Page.authenticate().

Rank #4
Sale
NexiGo N930AF 1080p Webcam with Microphone and Privacy Cover, AutoFocus, Noise Reduction, HD USB Web Camera, for Zoom Meeting YouTube Skype FaceTime, PC Mac Laptop Desktop (Renewed)
  • HD Webcam 1080p AutofocusThis 1080P web camera supply crisp image and crystal clear video, great for webinars, and video conferencing. Focus range 7cm to infinity and full HD means your recorded videos are crisp and vibrantly colored, compatible with 19201080p at 30fps etc. Autofocus and facial-enhancement technology optimize the image automatically, makes you look more beautiful in the video.
  • Webcam with Privacy Cover Cover overs your web camera when it is not in use and prevents web hackers from spying on you. It is perfect to provide privacy, security, and peace of mind to individuals, groups, organizations, companies, and governments. At the same time, it protecting the lens from the dirty.
  • Webcam with MicrophoneClear and natural sound, computer web camera featured with noise reduction and echo-canceling technology, communication. Capture your voice from every angle, to make sure you are heard very clearly.
  • USB Webcam Plug and Play USB web camera for computer, easy to set up, and no driver is needed (with 2M, 6.5ft USB power cable ). Adjustable universal clip can meet your multi-angle needs on computers, laptops, desktops, Mac, PC, LCD monitors, and even other flat surfaces

Fix request interception if requests stall

Puppeteer’s official request-interception guide states: “Once request interception is enabled, every request will stall unless it’s continued, responded or aborted.” See Request interception. Ensure each handler continues, responds to, or aborts every intercepted request, and that no request is resolved twice. A stalled login API call or dashboard script can leave the page at login or prevent the dashboard from becoming ready.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot by symptom

Symptom Likely explanation Next check
Final URL is the login route The site redirected the request because the active browser state was absent, expired, or rejected. Verify the same context/profile is used; run the authorized login flow or restore a valid test session, then navigate again.
Final URL looks like the dashboard, but the login form appears The application may render a login view in place, or dashboard loading may have failed. Check both login and dashboard selectors, plus relevant safe console and response status diagnostics.
Navigation resolves but dashboard selector times out The navigation promise only indicates that its wait condition was met; app rendering or data loading may still be incomplete, or auth may have failed. Inspect the URL and selector presence; wait on a stable app-specific readiness signal rather than adding an arbitrary delay.
Login works locally but fails in CI CI may use a fresh profile, separate context, unwritable profile directory, or different SSO/MFA behavior. Make session setup explicit, check profile permissions and context reuse, and avoid sharing session secrets or profiles across jobs.
Intermittent blank or incomplete dashboard A request may be stalled by interception or the application may still be loading. Audit interception handlers and wait for the selector or app-ready state needed for the capture.
Authentication only works with HTTP credentials The endpoint may use HTTP authentication rather than an application login form. Use Page.authenticate() only for that HTTP-auth case; do not treat it as a replacement for a site’s normal login flow.

Or skip the browser setup

If the goal is a screenshot rather than testing your application’s login flow, ScreenshotNeo offers a one-request screenshot API. See the API documentation for options and response details.

Best Value
Sale
1080P HD Webcam with Microphone ,USB HD Computer Web Camera Auto Focus
  • 【1080P Full HD Webcam】 Experience smooth and clear video calls with this 1080P Full HD webcam, powered by a new CMOS sensor for improved clarity and color performance. Whether you're using this camera for remote work, online teaching, or virtual meetings, it delivers high-definition video that helps you communicate with confidence on your computer.
  • 【Instant Auto Focus Webcam】 This webcam locks onto you instantly — whether you lean in to show a product or lean back to talk. No manual adjustments, no delay. Perfect for live streaming, product demos, or online classes, this camera ensures you stay sharp and clear throughout every call, making it a reliable choice for your computer setup.
  • 【Plug-and-Play Webcam with Anti-Interference Cable】 Set up this webcam in seconds — no drivers needed. Just plug it into any USB port on your computer and you're ready to go. The included USB cable features a built-in ferrite core that reduces interference, ensuring stable video transmission for your camera during important meetings.
  • 【Built-in Noise Microphones Webcam】 This webcam features Built-in Noise Cancellation mics that capture your voice naturally from different angles. Ideal for conferences, video chats, or streaming, the microphones help ensure your audio comes through clearly.
  • 【Privacy Cover Webcam】 This webcam includes a privacy cover that you can slide to conceal the lens when not in use. It's a simple yet effective security feature that gives you peace of mind, especially when working from home or using this camera in shared spaces. Your computer stays protected with this thoughtful design.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/dashboard -o shot.webp

ScreenshotNeo accepts cookie and consent banners and removes 60+ known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks/CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers indicate the page verdict and billing status. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.

Sign up free for 1,000 screenshots a month, with no card required.

Frequently Asked Questions

Does a successful `page.goto()` mean Puppeteer is logged in?

No. It means the navigation completed according to its wait condition. Check the final URL and assert a dashboard-specific element before capturing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can I use `Page.authenticate()` to sign in to a normal website?

No. It supplies credentials for HTTP authentication, not a general web-application login flow.

Why did my restored cookies not open the dashboard?

The cookies may be expired, scoped to a different domain or path, absent from the active context, or insufficient for the site’s session mechanism. Confirm session validity and follow the site’s authorized authentication flow.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.