Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using QTP to capture screen shot
#9
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi All, I am new [typical] to QTP and I can't get the screenshot to work. I need to capture a screenshot of each screen that my script runs through for evidence sake.

If I have my understanding correct I need to create the function via the function definition generator tool?

The below is my script. However My screenshot code is failing every time. Can anyone help?

My appreciated in advance.


Code:
'RegisterUserFunc "Browser", "CaptureBitmap", "fnCaptureBitmap1"
Browser("Santander UK").Page("Santander UK").Image("idUserMenu").Click
'login user'
Browser("Intranet Login").Page("Intranet Login").WebEdit("calias").Set "c0234599"
Browser("Intranet Login").Page("Intranet Login").WebEdit("cpassword").SetSecure "54d52cac4a591499190479343ef8adc2f850270e6a8074ed81545d5baee1"
'navigate to customer search'
Browser("Intranet Login").Page("Intranet Login").WebButton("OK").Click
Browser("Intranet Login").Page("Intranet Login").Frame("menuIzq").WebElement("Customer Database").Click

'search for customer'
Browser("Intranet Login").Page("Intranet Login").Frame("menuIzq").Link("Details Management").Click
Browser("Intranet Login").Page("Intranet Login").Frame("AreaTrabajo").WebList("select").Select "Customer Number"
Browser("Intranet Login").Page("Intranet Login").Frame("AreaTrabajo").WebEdit("WebEdit").Set "33809222"
Browser("Intranet Login").Page("Intranet Login").Frame("AreaTrabajo").Link("Search").Click

'#####################
'Capture screenshot
'#####################
Public Function ScreenshotCapture(ByRef test_object)
'Browser("Intranet Login").Page("Intranet Login").CaptureBitmap "C:\QTP\Screenshots"
End Function
RegisterUserFunc "Image", "CaptureBitmap", "ScreenshotCapture"

Browser("Intranet Login").Page("Intranet Login").Frame("AreaTrabajo_2").Link("Details").Click
Browser("Intranet Login").Page("Intranet Login").Frame("AreaTrabajo_2").WebElement("0015").Click
Browser("Intranet Login").Page("Intranet Login").Frame("AreaTrabajo_2").Link("Details").Click
Browser("Intranet Login").Page("Intranet Login").Frame("AreaTrabajo_2").Link("Address").Click
'################################
'Capture Screenshot
'################################

'Test End
Reply


Messages In This Thread
Using QTP to capture screen shot - by ravi.gajul - 01-31-2012, 11:08 PM
RE: Using QTP to capture screen shot - by Ankesh - 02-01-2012, 05:11 PM
RE: Using QTP to capture screen shot - by rajpes - 02-03-2012, 08:37 AM
RE: Using QTP to capture screen shot - by Ankesh - 02-03-2012, 10:48 AM
RE: Using QTP to capture screen shot - by sims - 02-09-2015, 07:41 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Capture screen shot for unexpected Errors. uma87 10 18,672 11-08-2014, 12:18 AM
Last Post: supputuri
  How to capture text from a tooltip using QTP sasmitakumari 2 15,016 04-03-2014, 05:59 PM
Last Post: Ankur
  qtp 11, Unable to prove the disappearance ofdynamic objects displayed on same screen. priyaang 1 2,458 03-24-2014, 12:53 AM
Last Post: supputuri
  capture screenshot using html code and view in QTP Test results Bhuvan 3 7,234 07-19-2013, 02:38 PM
Last Post: Bhuvan
  How to get uppermost java object displayed on screen using QTP shirkaan_2010 1 4,941 07-29-2011, 01:41 PM
Last Post: rajpes

Forum Jump:


Users browsing this thread: 7 Guest(s)