Followings is the method to capture any image from webpage:
Following are the steps that you need to perform to use capturebitmap method,
- Record the image that you need to capture. i.e If you want to capture the “google” fromg google homepage than you just need to click on that image.
- After clicking, you will get one line of code like following,
- Modify above line of code to following,
- Browser(“Google”).Page(“Google”).CaptureBitmap “C:\GoogleImage.bmp
And execute it, you will get “Google” image in “GoogleImage.bmp” file under “c:” directory.
- If you want to capture whole screen of desktop, that also you can do using this method, following is the example to achieve it,
- Desktop.CaptureBitmap “c:\DesktopImage.bmp”
- You can also save Image .Png format using capturebitmap method in QTP.