The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> Micro Focus/Compuware TestPartner

Pages: 1 | 2 | >> (show all)
sankhu
Newbie


Reged: 11/24/06
Posts: 23
taking screenshots in test partner
      #367416 - 03/21/07 06:44 AM


i want to know is it possible to take screenshots during
script execution in testpartner incase if error occur and save it somewhere if yes if you can give the code it will be helpful to me .


Post Extras: Print Post   Remind Me!   Notify Moderator  
DSquaredModerator
Moderator


Reged: 04/02/03
Posts: 4546
Loc: Wisconsin, USA
Re: taking screenshots in test partner [Re: sankhu]
      #367424 - 03/21/07 07:12 AM

What have you tried?

Post Extras: Print Post   Remind Me!   Notify Moderator  
Aracknid
Advanced Member


Reged: 09/22/04
Posts: 555
Loc: Toronto, Canada
Re: taking screenshots in test partner [Re: sankhu]
      #367426 - 03/21/07 07:16 AM

There is no function built into TestPartner to do this, but there is a third party add-in available for free from 'Mr.TechGuy' that does it. We use it and it's great. You can find it at the place listed below.

(I grabbed this from another post)
Go to Yahoo's TPUser group (logon required to see the file downloads):

http://tech.groups.yahoo.com/group/TPUser/

Click "Files" in the upper-left "menu" to get to:

http://tech.groups.yahoo.com/group/TPUser/files/

Click "Utilities" to get to:

http://tech.groups.yahoo.com/group/TPUser/files/Utilities/


Aracknid

--------------------
TestPartner:
Current AUT running test scripts on TP 6.3 build 183, SQL 2000 DB.
Legacy AUT running on TP 5.6.0 Build 81 and TP 6.2 build 449 with SQL 2000 DB.

Test Environment:
TP/IE Clients on VMWare ESX 4.1 server, AUT Servers on VMWare ESX 3.5 server.

Application Under Test (AUT):
Client/Server based, IE 7/8 interface with SQL 2005/2008 DB.

Automating with TP since August 2004.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Kaza
Junior Member


Reged: 09/20/02
Posts: 25
Loc: Espoo
Re: taking screenshots in test partner [Re: Aracknid]
      #393450 - 06/28/07 12:52 AM

Someone in other thread posted that TestPartner 6.0 now has build in functionality to take screenshots. Is that true? I tried to find it but with no luck.

Post Extras: Print Post   Remind Me!   Notify Moderator  
DSquaredModerator
Moderator


Reged: 04/02/03
Posts: 4546
Loc: Wisconsin, USA
Re: taking screenshots in test partner [Re: Kaza]
      #393539 - 06/28/07 05:28 AM

Quote:

Someone in other thread posted that TestPartner 6.0 now has build in functionality to take screenshots. Is that true? I tried to find it but with no luck.




That was me, and I may have misunderstood the original comment that promted me to reply.

I don't know of built in functionality to capture screenshots on the fly. What I was referring to was the new visual test component, which is all based on screenshot and manipulating data directly in those screenshots.

My bad.


Post Extras: Print Post   Remind Me!   Notify Moderator  
pzm130
Newbie


Reged: 07/23/07
Posts: 11
Re: taking screenshots in test partner [Re: Aracknid]
      #629781 - 06/08/10 12:45 PM

Quote:

There is no function built into TestPartner to do this, but there is a third party add-in available for free from 'Mr.TechGuy' that does it. We use it and it's great. You can find it at the place listed below.

(I grabbed this from another post)
Go to Yahoo's TPUser group (logon required to see the file downloads):

http://tech.groups.yahoo.com/group/TPUser/

Click "Files" in the upper-left "menu" to get to:

http://tech.groups.yahoo.com/group/TPUser/files/

Click "Utilities" to get to:

[url=http://tech.groups.yahoo.com/group/TPUser/files/Utilities/
]http://tech.groups.yahoo.com/group/TPUser/files/Utilities/
[/url]

Aracknid




Hey Aracknid-
Doesn't look like the TPHelperCommands.dll is present in that forum. Is there anywhere else I can get it? I have TPHelpercommands but it looks like we don't have the latest version, as when I try to create a "snapshot" object with the .dll referenced TP doesn't recognize it.

Thanks


Post Extras: Print Post   Remind Me!   Notify Moderator  
mouliarun1985
Member


Reged: 05/08/10
Posts: 157
Loc: TN , IND
Re: taking screenshots in test partner [Re: pzm130]
      #629894 - 06/09/10 04:42 AM

Under that forum , no such utility is present !

Can i have the original link pls !


Post Extras: Print Post   Remind Me!   Notify Moderator  
QAExplorer
Member


Reged: 10/17/07
Posts: 25
Re: taking screenshots in test partner [Re: mouliarun1985]
      #630782 - 06/15/10 11:38 PM

This function will capture the screen shot,

Sub fnScreenShot(sPath As String)


Dim oWord As Object

Window("Application=EXPLORER.EXE Caption=''").Attach
Window.Type "{PrintScrn}"
Set oWord = CreateObject("Word.Application")
oWord.DisplayAlerts = False
With oWord
.Visible = False
.DOCUMENTS.Add
.Selection.Paste
.ActiveDocument.SaveAs FileName:=sPath
.ActiveDocument.Close False
.QUIT False
End With

Set oWord = Nothing

End Sub


Post Extras: Print Post   Remind Me!   Notify Moderator  
pzm130
Newbie


Reged: 07/23/07
Posts: 11
Re: taking screenshots in test partner [Re: QAExplorer]
      #630949 - 06/16/10 11:15 AM

I've seen this code posted in the forum before. The problem is, what do you do if you are running on a machine that does not have the ms office suite installed? This is the reason I cannot use this function for my screenshots - we don't always have word installed on the execution machine.

Post Extras: Print Post   Remind Me!   Notify Moderator  
Aracknid
Advanced Member


Reged: 09/22/04
Posts: 555
Loc: Toronto, Canada
Re: taking screenshots in test partner [Re: pzm130]
      #631006 - 06/16/10 01:41 PM Attachment (314 downloads)

OK, I've attached the required files to do a screen shot that used to be posted in the TPUsers group. I'm not sure if this is allowed, so appologies if it is not. I'm just trying to help out my fellow testers.

Installation: This is a self-extracting EXE. I added '.zip' to the end so I could upload it. You should remove the '.zip'. Extract the DLL and HTML help file. Put the DLL where ever you want. Add a reference to it in your script. READ THE HTML HELP to learn how to use it. You might need to regiser the DLL (using REGSVR32.DLL on the command prompt.... cannot remember).

DISCLAIMER: I didn't create this add-on. Full credit for it goes to Mr. TechGuy, who ever he is. I don't provide support for it. If it works for you, then great. If not, then you can ask for help, but don't expect it. Certainly, you should not expect any updates to the code, as it is over 4 years old already. If anything, I'd advise you not to use this. Once you become dependant on it, you will really be in a jam shouldit stop working in a later release (update) of TestPartner.

--------------------
TestPartner:
Current AUT running test scripts on TP 6.3 build 183, SQL 2000 DB.
Legacy AUT running on TP 5.6.0 Build 81 and TP 6.2 build 449 with SQL 2000 DB.

Test Environment:
TP/IE Clients on VMWare ESX 4.1 server, AUT Servers on VMWare ESX 3.5 server.

Application Under Test (AUT):
Client/Server based, IE 7/8 interface with SQL 2005/2008 DB.

Automating with TP since August 2004.

Edited by Aracknid (06/16/10 01:43 PM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
pzm130
Newbie


Reged: 07/23/07
Posts: 11
Re: taking screenshots in test partner [Re: Aracknid]
      #631212 - 06/17/10 02:04 PM

Thanks Aracknid. I won't have time to look at this til next week but I downloaded the zip in case it mysteriously disappears from the forum. If this works it will be solving a problem we've been trying to tackle for a while now.

Post Extras: Print Post   Remind Me!   Notify Moderator  
ddkannan
Member


Reged: 05/28/10
Posts: 43
Re: taking screenshots in test partner [Re: pzm130]
      #631255 - 06/18/10 12:20 AM

Taskbar("Index=1").Attach
Button("Caption=Start").Click
Window("Application=EXPLORER.EXE Caption='Start Menu'").Attach
ListView("Index=2").Select "Run..."
Window("Application=EXPLORER.EXE ClassName='#32770' Caption=Run").Attach
ComboBox("Label='&Open:'").SetText "winword.exe"
Button("Caption=OK").Click

Window("Application=WINWORD.EXE Caption='Document1 - Microsoft Word'").Attach
Window.Size 1106, 660
Window.Move 81, 54
Window("Application=WINWORD.EXE Caption='Document1 - Microsoft Word'").Attach

Window("Caption=Document1", tpAttachChild).Attach
GUIObject("ClassName=_WwG Caption='Microsoft Word Document'").Type str 'ur name'
GUIObject("ClassName=_WwG Caption='Microsoft Word Document'").Type "{Ctrl VS}"

Window("Application=WINWORD.EXE ClassName='#32770' Caption='Save As'").Attach
ComboBox("Index=1").SetText fname
Button("Caption=&Save").Click

Window("wordclose").Attach
GUIObject("ClassName=_WwG Caption='Microsoft Word Document'").Type "{Alt {F4}}"


Post Extras: Print Post   Remind Me!   Notify Moderator  
ddkannan
Member


Reged: 05/28/10
Posts: 43
Re: taking screenshots in test partner [Re: ddkannan]
      #631256 - 06/18/10 12:23 AM

The above code will work fine ya..................

Post Extras: Print Post   Remind Me!   Notify Moderator  
ddkannan
Member


Reged: 05/28/10
Posts: 43
Re: taking screenshots in test partner [Re: ddkannan]
      #631992 - 06/23/10 11:39 PM

Is it working?

Post Extras: Print Post   Remind Me!   Notify Moderator  
stansult
Newbie


Reged: 04/04/08
Posts: 3
Loc: CA
Re: taking screenshots in test partner [Re: sankhu]
      #632033 - 06/24/10 01:56 AM

It's not about test partner, but it may help.
I test flash and make scripts using autohotkey.
So on any failure my script makes a screenshot that I use for test report. For the screenshot I use command-line screenshot application i found, called MiniCap. To make a screenshot of the region, I use it as stated below (i send it as a command line from my script, just making sure that script doesn't run until the command is completed):

MiniCap.exe -captureregion x1 y1 x2 y2 -exit -save imagefile.ext
  • captureregion command to (guess what?) capture a region
  • x1,x2,y1,y2 coordinates of the region (defined by script, usually I use whole screen in current resolution)
  • exit command to exit the application after screenshot is done (important!)
  • save imagefile.ext save screenshot in the file
Im using png, but it also works with jpg, gif, pdf, bmp, tiff. Depends on the extension you use in the command.

Hope it helps. For me it works great!


Post Extras: Print Post   Remind Me!   Notify Moderator  
pzm130
Newbie


Reged: 07/23/07
Posts: 11
Re: taking screenshots in test partner [Re: ddkannan]
      #632791 - 06/29/10 01:51 PM

Quote:

Is it working?



I ended up using the snapshot function in the TPHelpercommands.dll and it works quite well...I'm taking a screenshot then zipping it to reduce the size. I chose not to use word because a) not all our execution boxes have word, so what do you do in that case? and b) I don't want to create a word document just to have a screenshot. This way I am just storing images, not word docs.

So I don't know if the office code works. Didn't try it


Post Extras: Print Post   Remind Me!   Notify Moderator  
mouliarun1985
Member


Reged: 05/08/10
Posts: 157
Loc: TN , IND
Re: taking screenshots in test partner [Re: pzm130]
      #633734 - 07/07/10 10:01 AM

Hi Sankhu , did you try using Wscript , if not google it ...

you have plenty to do with Windows Scripting ! It really helps many areas in automation


Post Extras: Print Post   Remind Me!   Notify Moderator  
tubaloth
Member


Reged: 02/13/07
Posts: 261
Re: taking screenshots in test partner [Re: mouliarun1985]
      #643445 - 09/24/10 11:31 AM

Is there any way to save the image as an Image instead of pasting it in Word. Even more is there a way to take the image from the clipboard saving that in an e-mail. I would think it would have to be an attachment.

Meaning, I wanted to see if I can add onto my OnError.

If it errors I grab a picture of whats on the screen (print screen). I wanted to sent that picture to me with the error.

Is this even possible. I can get the image into the Clipboard. but I don't know how to create an image object in VBA/Test Partner.


Post Extras: Print Post   Remind Me!   Notify Moderator  
invaderchin
Newbie


Reged: 02/28/11
Posts: 16
Re: taking screenshots in test partner [Re: Aracknid]
      #669601 - 04/27/11 04:05 PM

thank you!

Post Extras: Print Post   Remind Me!   Notify Moderator  
tubaloth
Member


Reged: 02/13/07
Posts: 261
Re: taking screenshots in test partner [Re: tubaloth]
      #670038 - 05/02/11 10:47 AM

Quote:

Is there any way to save the image as an Image instead of pasting it in Word. Even more is there a way to take the image from the clipboard saving that in an e-mail. I would think it would have to be an attachment.

Meaning, I wanted to see if I can add onto my OnError.

If it errors I grab a picture of whats on the screen (print screen). I wanted to sent that picture to me with the error.

Is this even possible. I can get the image into the Clipboard. but I don't know how to create an image object in VBA/Test Partner.





This is the way I figured out how to do it. The problem is you do need a Reference to the TPHelperFile. But it seems like on the OnError Script needs the reference.

I'll leave the old Commented out way in this.

Quote:


'Screen Grab
On Error Resume Next

' Capture the screen
' With Window("Application=EXPLORER.EXE ClassName=Shell_TrayWnd Caption=''")
' .Attach
' .Type ("{PrintScrn}")
' End With

' Save the capture
Dim wrd, ToDOC, fso, captureName
Dim captureFilePath As String
captureFilePath = "C:\ErrorImage-" & Format(Now, "mmddhhnn") & ".jpg"

' add reference to TPHelperCommands
Dim ScreenShot As New SnapShot

ScreenShot.SaveDesktopInJPEGFile captureFilePath

' Set wrd = CreateObject("Word.Application")
' wrd.Visible = False
' 'Set fso = CreateObject("Scripting.FileSystemObject")
' Set ToDOC = wrd.Documents.Add()
' ToDOC.SaveAs (captureFilePath)
' ToDOC.Content.Paste
' ToDOC.Save
' ToDOC.Close
' Set ToDOC = Nothing
' wrd.Quit SaveChanges:=wdPromptToSaveChanges
' Set wrd = Nothing

'E-mail

Dim emailAddress As String

Set emailMessage = CreateObject("CDO.Message")
emailMessage.To = emailAddress
emailMessage.From = emailAddress
emailMessage.Subject = "-Automation Error from " & SystemInfo.ComputerName
emailMessage.TextBody = errorString
emailMessage.AddAttachment captureFilePath


emailMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
emailMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "jadmin1"

emailMessage.Configuration.Fields.Update

emailMessage.Send
popupPanel "Error E-mail Sent to " & emailAddress, 2
Set emailMessage = Nothing





Edited by tubaloth (05/02/11 10:50 AM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
JeffCull
Newbie


Reged: 06/01/11
Posts: 2
Re: taking screenshots in test partner [Re: tubaloth]
      #679419 - 07/19/11 01:32 PM


I have done this recently, and the way i went about it was with a tool I found online called CommandCapture (CMDCapture). Google it and i am sure you will find it. It is a simple exe that will capture the whole screen when ran from the commandline (or with a shell command from TP). Worked out really well.


Post Extras: Print Post   Remind Me!   Notify Moderator  
asleep
Newbie


Reged: 05/10/07
Posts: 1
Re: taking screenshots in test partner [Re: tubaloth]
      #680811 - 08/01/11 04:24 PM

One thing that I've done to grab is screen shot when errors occur is to do a bitmap check comparing it blank image. It's very convenient because the screen shot is tied directly to the individual results. No need for third party solutions.

Post Extras: Print Post   Remind Me!   Notify Moderator  
JMI
Advanced Member


Reged: 11/06/02
Posts: 537
Loc: Lausanne, Switzerland
Re: taking screenshots in test partner [Re: Aracknid]
      #711335 - 07/03/12 06:11 AM

Quote:

Certainly, you should not expect any updates to the code, as it is over 4 years old already. If anything, I'd advise you not to use this. Once you become dependant on it, you will really be in a jam should it stop working in a later release (update) of TestPartner.




Well, I am dependant on TPHelperCommands and I begin to try my TestPartner scripts on Windows7. I get the "ActiveX component can't create object" error while trying to create one of HelperCmds objects.

Does any of you use TestPartner with TPHelperCommands on Windows7?

I use TestPartner 6.1 (Build 7601) Service Pack 1.
My scripts work well on Windows XP.


Post Extras: Print Post   Remind Me!   Notify Moderator  
lslackware
Newbie


Reged: 08/17/12
Posts: 6
Re: taking screenshots in test partner [Re: tubaloth]
      #714768 - 08/17/12 04:03 AM

My solution is to use autoit for this:
Just compile some small autoit utility:
Code:

#include <ScreenCapture.au3>
If $CMDLINE[0] = 1 Then
$filename = $CMDLINE[1]
_ScreenCapture_SetJPGQuality(50)
_ScreenCapture_Capture($filename)
EndIf


After that, from windows cmd run command "path_to_your_folder\screenshot.exe" "C:\somefolder\my_screenshot.jpg"

N.B. screenshot quality in this example is reduced to 50%.
Also, don't forget about autoit library ScreenCapture.au3 which is needed for this example

Edited by lslackware (08/17/12 04:04 AM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
JMI
Advanced Member


Reged: 11/06/02
Posts: 537
Loc: Lausanne, Switzerland
Re: taking screenshots in test partner [Re: lslackware]
      #715565 - 08/30/12 03:08 AM

My problem with TPHelperCommands on Windows7 machine was due to TPHelperCommands being a 32 bit DLL while my machine is 64 bit... I found a recipe for installing 32bit DLLs on Windows7 64bit (thank you, Google!) and it works OK.
Well, almost - I could not make screen copies in the JPEG format, so I do them as Bitmap now.


Post Extras: Print Post   Remind Me!   Notify Moderator  
tubaloth
Member


Reged: 02/13/07
Posts: 261
Re: taking screenshots in test partner [Re: JMI]
      #716440 - 09/13/12 11:43 AM

Quote:

My problem with TPHelperCommands on Windows7 machine was due to TPHelperCommands being a 32 bit DLL while my machine is 64 bit... I found a recipe for installing 32bit DLLs on Windows7 64bit (thank you, Google!) and it works OK.
Well, almost - I could not make screen copies in the JPEG format, so I do them as Bitmap now.




I was a little worried about this, with me getting a Windows 7 machine.

I just installed/unziped the TPHelper commands fine. I had change a couple of scripts to reference the Snapshot function. But its taking screen shots just like before (in JPG). I was just reminded of this when it took a screen shot a full 1920 x 1080.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1 | 2 | >> (show all)



Extra information
0 registered and 4 anonymous users are browsing this forum.

Moderator:  Myrtle, Jim Brennan, AJ, DSquared 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 21292

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5