Follow below navigation to get line numbers in expert view(QTP).
Tools -> Editor Options -> General tab -> Check show line numbers check box and click on OK button.
Data Driven Testing
SQL Queries Collection
Movie Songs Lyrics
QTP Faqs
SQL Faqs
Navigation To Get Line Numbers In Expert View
Descriptive Programming to Capture Tool Tip Text in QTP
Tooltip:A tooltip is a small pop-up window that appears when a user pauses the mouse pointer over an element.
QTP Script to capture tooltip.
Below script is for capturing tooltip of textbox in google Site.
SystemUtil.Run"iexplore","http://www.google.com/"
a=Browser("name:=Google").Page("title:=Google").WebEdit("name:=q").Object.title
msgbox a
QTP Script to capture tooltip of image.
SystemUtil.Run"iexplore","http://www.yahoomail.com/"
b=Browser("name:=Yahoo.*").Page("title:=Yahoo.*").Image("src:=https://a248.e.akamai.net/sec.yimg.com/i/reg/bnr_28.jpg").getROProperty("alt")
msgbox b
QTP Script to capture tooltip of link.
SystemUtil.Run"iexplore","http://www.yahoomail.com/"
c=Browser("name:=Yahoo.*").Page("title:=Yahoo.*").Link("name:=Yahoo!").object.title
msgbox c
Datatable Methods
Script for Connecting to Database
Movie Songs Lyrics
SQL Queries Collection
Descriptive Programming For Playing a Video in Youtube
QTP Script to play a video(qtp scripts)in Youtube.
Systemutil.Run"iexplore","www.youtube.com"
Browser("name:=YouTube - Broadcast Yourself.").Page("title:=YouTube.*").WebEdit("name:=search_query","html id:=masthead-search-term").Set "qtp scripts"
Browser("name:=YouTube - Broadcast Yourself.").Page("title:=YouTube.*").WebButton("name:=Search","html id:=search-button").Click
Browser("name:=YouTube - Broadcast Yourself.").Page("title:=YouTube.*").Link("name:=QTP Scripts","html id:=video-long-title-qI_5rL7iGkI").Click
VBScript String Functions(2)
VBScript String Functions(1)
1.LTrim
2.RTrim
3.Trim
4.Replace
5.StrReverse
6.Space
LTrim Function:Removes spaces on the left side of a string.
Syntax:LTrim(string)
Ex1:a=LTrim(" LAKSHMI ")
Msgbox a
Output=LAKSHMI .
RTrim Function:Removes spaces on the right side of a string.
Syntax:RTrim(string)
Ex1:a=RTrim(" LAKSHMI ")
Msgbox a
Output= LAKSHMI.
Trim Function:Removes spaces on both the left and the right side of a string.
Syntax:Trim(string)
Ex1:a=Trim(" LAKSHMI ")
Msgbox a
Output=LAKSHMI.
Replace Function:Replaces a specified part of a string with another string a specified number of times.
Syntax:Replace(expression, find, replacewith[, start[, count[, compare]]])
where start,count,compare are optional.
expression:String expression containing substring to replace.
find:Substring being searched for.
replacewith:Replacement substring.
start(Optional):Position within expression where substring search is to begin. If omitted,1 is assumed.
count(Optional):Number of substring substitutions to perform. If omitted, the default value is -1, which means make all possible substitutions.
compare(Optional):Numeric value indicating the kind of comparison to use when evaluating substrings.If omitted,the default value is 0, which means perform a binary comparison.
Ex1:a= Replace("abacadaeaf","a","x")
Msgbox a
Output=xbxcxdxexf.
Ex2:a=Replace("abacadaeaf","a","x",1,3)
Msgbox a
Output=xbxcxdaeaf.
As we are giving values for start and count parameters(optional)in above example only first 3 a's are replaced by x.
StrReverse Function:Reverses a string.
Syntax:StrReverse(string)
Ex1:a=StrReverse("Lakshmi")
Msgbox a
Output=imhskaL.
Space Function:Creates a string with the specified number of spaces.
Syntax:Space(number)
Ex1:a="Welcome"&space(5)&"All"
Msgbox a
Output=Welcome All.