Jump to content

Full Window Screenshot using webdriverUDF


Recommended Posts

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

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

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?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...