MRAJ Posted July 14, 2021 Share Posted July 14, 2021 Hello, I am using WD UDF edge browser for my websites. Currently i am using below scripts to take the screenshot, but the screenshot is browser headless and no full window with background. Sometimes my websites will load slow in that scenario, screenshot is white page and not able to find what is the reason behind this. Is there any way to take the full window with browser head which will show me loading of my page I tried with below but they are taking not full window screesnhot: $sResponse = _WD_Window($sSession, 'screenshot') $bDecode = _Base64Decode($sResponse) $sDecode = BinaryToString($bDecode) $hFileOpen = FileOpen("Screen2.png") FileWrite($hFileOpen, $sDecode) FileClose($hFileOpen) and $ScreenShot = _WD_Screenshot($sSession) $FileName = "test.jpg" $FilePath = FileOpen("path" & $FileName, 18) FileWrite($FilePath, $ScreenShot) FileClose($FilePath) . Link to comment Share on other sites More sharing options...
Nine Posted July 14, 2021 Share Posted July 14, 2021 Take a look at ScreenCapture Management in UDF section of help file. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector GIF Animation (cached) Screen Scraping Link to comment Share on other sites More sharing options...
Danp2 Posted July 14, 2021 Share Posted July 14, 2021 @MRAJ Based on your description, it sounds like you need to add code to ensure that the webpage is fully loaded. Maybe as simple as calling _WD_LoadWait or maybe _WD_WaitElement. Rereading your post, it seems that you are describing two different issues. Is that correct? WebDriver UDF [GH&S] Latest version Wiki FAQs Link to comment Share on other sites More sharing options...
MRAJ Posted July 14, 2021 Author Share Posted July 14, 2021 Rereading your post, it seems that you are describing two different issues. Is that correct? NO I am just looking the screenshot should be full screen with background ( eg: if desktop main page and browser head). Like in IE it was taking the full screen window and browser head with Local $hBmp ; Capture full screen $hBmp = _ScreenCapture_Capture("") ; Save bitmap to file _ScreenCapture_SaveImage("path" & $hBmp) Link to comment Share on other sites More sharing options...
Danp2 Posted July 14, 2021 Share Posted July 14, 2021 AFAICS, the WebDriver specs don't currently support full document screenshots. You may be able to accomplish this via calls to CDP The current implementation of _WD_ExecuteCdpCommand is Chrome specific, but I'm currently working on a generic version that should work with all major browsers. Not sure if this would work for you, but have you considered using _WD_PrintToPDF instead? WebDriver UDF [GH&S] Latest version Wiki FAQs Link to comment Share on other sites More sharing options...
MRAJ Posted July 14, 2021 Author Share Posted July 14, 2021 I have not used _WD_PrintToPDF, will check this if this works. Thanks. Link to comment Share on other sites More sharing options...
MRAJ Posted July 14, 2021 Author Share Posted July 14, 2021 Is this correct way? $ScreenShot = _WD_PrintToPDF($sSession) $FileName = "test.jpg" $FilePath = FileOpen("path" & $FileName, 18) FileWrite($FilePath, $ScreenShot) FileClose($FilePath) Link to comment Share on other sites More sharing options...
Danp2 Posted July 14, 2021 Share Posted July 14, 2021 Per the WebDriver specs -- Quote The print functions are a mechanism to render the document to a paginated format. It is returned to the local end as a Base64 encoded string containing a PDF representation of the paginated document. You will need to convert it if you need it in a different format. WebDriver UDF [GH&S] Latest version Wiki FAQs Link to comment Share on other sites More sharing options...
KaFu Posted July 16, 2021 Share Posted July 16, 2021 (edited) Not what you're asking for, but maybe still fits your needs. Edited July 16, 2021 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21)HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now