Friday, December 24, 2010

MouseOver, Font, Color, Size, Background color,Change in Link color

Get the colour of the link after moving the mouse over the link on webpage

msgbox Browser("").Page("").Link("").Object.currentstyle.color    'Before moving the mouse over the link
Setting.WebPackage("ReplayType") = 2
Browser("").Page("").Link("").FireEvent "onmouseover"
msgbox Browser("").Page("").Link("").Object.currentstyle.color       'After moving the mouse over the link


The same way you can find the Font Size, Font Name  etc.

Browser("").Page("").Link("").Object.currentstyle.color
Browser("").Page("").Link("").Object.currentstyle.fontSize
Browser("").Page("").Link("").Object.currentstyle.fontFamily
Browser("").Page("").Link("").Object.currentstyle.backgroundColor

Tuesday, November 30, 2010

How to Calculate Transaction Time for a functional transaction with the help of QTP?

Using MercuryTimers you can find out the transaction time.



Systemutil.run "http://www.google.com"
For i=0 to 3
Browser("title:=Google").Page("title:=Google").WebEdit("name:=q","micclass:=WebEdit").Set DataTable("search_term",global)

MercuryTimers("Search").Start 
Browser("title:=Google").Page("title:=Google").WebButton("name:=Google Search","micclass:=WebButton").Click
Browser("title:=.*Google Search").Page("title:=.*Google Search").Sync
Reporter.ReportEvent micDone,"Search Time for Iteration "&i+1,""& MercuryTimers.Timer("Search").ElapsedTime/1000
MercuryTimers("Search").Stop

DataTable.SetNextRow
Browser("title:=.*Google Search").Back
MercuryTimers.Timer("Search").Reset
Next

Note:
'Create a Column "search_term"  in DataTable ( Global Sheet)
'Enter 4 different search Terms




Mercury Timer   Transaction Time   End to End Testing