Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

326
Views
how to interact with shadow DOM elements for take the file.pdf with selenium 4.x, using php and chrome driver V95.0.?

Explain better: I am automating the issuance of a certificate that is being generated in iframes

Through the selenium grid I managed to get to this last screen where the pdf is selenium_grid I tried to print the screen with window.print running a javascript, I see the window for print but I couldn't proceed :

$this->driver->executeScript("window.print()");






document.querySelector('pdf-viewer').shadowRoot.querySelector('viewer-toolbar').shadowRoot.querySelector('viewer-download-controls').shadowRoot.querySelector('cr-icon-button').click();//this work in browser, nope with selenium

From where I am I think there could be some ways to solve which I tried but didn't make any progress:

  • after windows.print() ,

    • press o key enter, maybe(two times),
    • click button save
  • maybe using keyboard control + s , key enter

  • right click, save page as, confirm

  • maybe using control + p

  • maybe using mouse for click in arrow down for download, but I got not find element, or dont know how to use coordinates for mouse

  • set preferences/capabilities for browser for when the window.print() not show where I liked save my pdf I too tried set a preferences I too tried $this->driver->getPageSource();

    $options->addArguments(['--print-to-pdf']);

that I find here but not sure if it is working or how to use it.

<iframe src="asintegrarelatorio?UGsAuJNIMg0Bs79efCz_UN+WLY3wJLa3shybBaN2MhtwcBuQ28HYLHZjlWoShKh3akHt0HZM3+pL7TP3ksZMQQ==" name="EMBPAGE" width="900px" height="500px" frameborder="1" align="center" title="" style="" scrolling="auto">
<html><head><script src="chrome-extension://mooikfkahbdckldjjndioackbalphokd/assets/prompt.js"></script></head><body style="height: 100%; width: 100%; overflow: hidden; margin:0px; background-color: rgb(82, 86, 89);"><embed name="C065A881B0E7E51799DF65DCF351573F" style="position:absolute; left: 0; top: 0;" width="100%" height="100%" src="about:blank" type="application/pdf" internalid="C065A881B0E7E51799DF65DCF351573F"></body></html>


</iframe>

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!