<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: [v1.31.1]</li>
<li>Operating System: [All, Windows 11, Ubuntu 20, macOS 13.2, etc.]</li>
<li>Browser: [All, Chromium, Firefox, WebKit]</li>
<li>Other info:</li>
</ul>
<h3 dir="auto">Source code</h3>
<p dir="auto"><strong>Code</strong><br>
page.screenshot(path=Path.cwd().parent / f"images/{page.title()}_screenshot.png", full_page=True)<br>
<strong>Sence</strong><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/39899297/224211306-37e7cdc2-10c0-4cca-9241-15178abc0664.png"><img src="https://user-images.githubusercontent.com/39899297/224211306-37e7cdc2-10c0-4cca-9241-15178abc0664.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto">[Describe expected behavior]<br>
When I use the scrolling screenshot to take a screenshot of a long page, the page contains pictures. After the screenshot is completed, the relevant pictures in the page are missing, and the circle pattern being loaded is displayed. I try to set the waiting time, but it doesn't work. I want to ask whether there is a way to wait for the page elements to be loaded completely before scrolling the screenshot？</p>
<h3 dir="auto">System info</h3>
<ul dir="auto">
<li>Playwright Version: 1.31.2</li>
<li>Operating System: Android 13</li>
<li>Browser: Chrome 112
<ul dir="auto">
<li>"Enable command line on non-rooted devices" is enabled in <code class="notranslate">chrome://flags</code>.</li>
</ul>
</li>
<li>Phone: Pixel 7 pro</li>
</ul>
<h3 dir="auto">Source code</h3>
<p dir="auto"><strong>Server script</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="async function launchAndroidServer() {
  const browserServer = await _android.launchServer({
    port: 5555,
    wsPath: &quot;ws&quot;,
  });

  const wsEndpoint = browserServer.wsEndpoint();
  console.log(&quot;wsEndpoint:: &quot;, wsEndpoint);
}

launchAndroidServer();"><pre class="notranslate"><span class="pl-k">async</span> <span class="pl-k">function</span> <span class="pl-en">launchAndroidServer</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">const</span> <span class="pl-s1">browserServer</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">_android</span><span class="pl-kos">.</span><span class="pl-en">launchServer</span><span class="pl-kos">(</span><span class="pl-kos">{</span>
    <span class="pl-c1">port</span>: <span class="pl-c1">5555</span><span class="pl-kos">,</span>
    <span class="pl-c1">wsPath</span>: <span class="pl-s">"ws"</span><span class="pl-kos">,</span>
  <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

  <span class="pl-k">const</span> <span class="pl-s1">wsEndpoint</span> <span class="pl-c1">=</span> <span class="pl-s1">browserServer</span><span class="pl-kos">.</span><span class="pl-en">wsEndpoint</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">"wsEndpoint:: "</span><span class="pl-kos">,</span> <span class="pl-s1">wsEndpoint</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-en">launchAndroidServer</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Client Script</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const { _android } = require('playwright');

(async () =&gt; {
  const device = await _android.connect(
      'ws://127.0.0.1:5555/ws'
  );

  console.log(`Model :: ${device.model()}, serial:: ${device.serial()}`)

  await device.shell('am force-stop com.android.chrome');
  const context = await device.launchBrowser();

  const page = await context.newPage();
  await page.goto('https://playwright.dev/');

  await page.close();
  await context.close();
})();
"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-kos">{</span> _android <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'playwright'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-kos">(</span><span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-k">const</span> <span class="pl-s1">device</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">_android</span><span class="pl-kos">.</span><span class="pl-en">connect</span><span class="pl-kos">(</span>
      <span class="pl-s">'ws://127.0.0.1:5555/ws'</span>
  <span class="pl-kos">)</span><span class="pl-kos">;</span>

  <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">`Model :: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">device</span><span class="pl-kos">.</span><span class="pl-en">model</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">}</span></span>, serial:: <span class="pl-s1"><span class="pl-kos">${</span><span class="pl-s1">device</span><span class="pl-kos">.</span><span class="pl-en">serial</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">}</span></span>`</span><span class="pl-kos">)</span>

  <span class="pl-k">await</span> <span class="pl-s1">device</span><span class="pl-kos">.</span><span class="pl-en">shell</span><span class="pl-kos">(</span><span class="pl-s">'am force-stop com.android.chrome'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">const</span> <span class="pl-s1">context</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">device</span><span class="pl-kos">.</span><span class="pl-en">launchBrowser</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

  <span class="pl-k">const</span> <span class="pl-s1">page</span> <span class="pl-c1">=</span> <span class="pl-k">await</span> <span class="pl-s1">context</span><span class="pl-kos">.</span><span class="pl-en">newPage</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">goto</span><span class="pl-kos">(</span><span class="pl-s">'https://playwright.dev/'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

  <span class="pl-k">await</span> <span class="pl-s1">page</span><span class="pl-kos">.</span><span class="pl-en">close</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">await</span> <span class="pl-s1">context</span><span class="pl-kos">.</span><span class="pl-en">close</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>Steps</strong></p>
<ul dir="auto">
<li>Run the server script</li>
<li>Run the client script</li>
</ul>
<p dir="auto"><strong>Expected</strong><br>
The script should open chrome browser and perform the steps.</p>
<p dir="auto"><strong>Actual</strong><br>
Chrome gets crashed. This behaviour isn't observed when I tried with Pixel 4 Android 12 emulator.<br>
The following args are added into the file at <code class="notranslate">/data/local/tmp/chrome-command-line</code></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="--disable-fre --no-default-browser-check --remote-debugging-socket-name=playwright-ed2eee3a7c8af55941c198437a6148a4 --disable-field-trial-config --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf"><pre class="notranslate"><code class="notranslate">--disable-fre --no-default-browser-check --remote-debugging-socket-name=playwright-ed2eee3a7c8af55941c198437a6148a4 --disable-field-trial-config --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf
</code></pre></div>
<p dir="auto">The chrome gets crashed when I start the test. Also after stopping the client and server script, chrome gets crashed when opened. Chrome starts working after I remove chrome args added to <code class="notranslate">/data/local/tmp/chrome-command-line</code>.</p>