Query Forum
How to capture tool tip in QTP?
E.g.: On Amazon.com, when you bring the mouse over the ‘A9′ search image (on the top-left side of the page), it shows ‘A9 search’ as tool-tip. This can be captured using following code: strToolTip= Browser(“title:=Amazon.*”).Page(“title:=Amazon.*”).Image(“src:=.*a9search.*”).getROProperty(“alt”)
msgbox strToolTip
How to Maximising a Browser?
Sub MaxBrowser( ByRef Browser )
hwnd= Browser.GetROProperty(“hWnd”)
Window(“hWnd:=”&hwnd).Maximize
End SubCall MaxBrowser(Browser(“micClass:=Browser”))
How to extract column from webpage ?
Dim colA(),colB()
totalRows = Browser(“<yourBrowser>”).Page(“<yourPage>”).WebTable(“<yourtable>”).RowCount
ReDim colA(totalRows), colB(totalRows)
For x = 1 to totalRows
colA(x) = Browser(“<yourBrowser>”).Page(“<yourPage>”).WebTable(“<yourtable>”).GetCellData(x,<firstcolumn>)
colB(x) = Browser(“<yourBrowser>”).Page(“<yourPage>”).WebTable(“<yourtable>”).GetCellData(x,<secondcolumn>)
Next
How to Capture Screen shot ?
Sub captureScreenShot ()
strStoreSnapshotMode = Setting(“SnapshotReportMode”)
Setting(“SnapshotReportMode”) = 0
Browser(“name:=.*”).Page(“title:=.*”).Sync
Setting(“SnapshotReportMode”) = strStoreSnapshotMode
End Sub
How to Call SQL stored procedure from QTP?
Function RunStoredProcedure(StoredProcedureName)
sDatabaseName=”ABC”
sUID=”xyz”
sPWD=”ABC_xyz” ‘ Create the database object
Set cm = CreateObject(“ADODB.Command”)
‘ Activate the connection.
cm.ActiveConnection = “DRIVER={Microsoft ODBC for Oracle}; ” &_
“SERVER=” & sDatabaseName & “;User ID=” & sUID & “;Password=” & sPWD & ” ;”
‘ Set the command type to Stored Procedures
cm.CommandType = 4
‘ Stored Procedures
cm.CommandText = StoredProcedureName
‘ Define Parameters for the stored procedure
cm.Parameters.Refresh
‘ Pass input value. Assuming Stored Procedure requires 2 parameters
cm.Parameters(0).Value = “Kuldeep”
cm.Parameters(1).Value = “Kumar”
‘ Execute the stored procedure
cm.Execute()
Set cm = Nothing
End Function
How to write the test Result (Output) on Excel sheet?
Dim objexcel
Set objexcel= CreateObject(“Excel.sheet”)
objexcel.Visible = True
objexcel.Workbooks.add
With Window(“Calculator”)
.WinButton(“5″).Click
.WinButton(“*”).Click
.WinButton(“3″).Click
.WinButton(“=”).Click
End With
result= Window(“Calculator”).WinEdit(“Edit”).GetROProperty(“text”)
If result=15 Then
objexcel.ActiveSheet.Cells(1,1).Value = “test is pass”
Reporter.ReportEvent micPass,”Calculation”, result
Else
objexcel.ActiveSheet.Cells(1,1).Value = “test is Fail”
Reporter.ReportEvent micFail,”Calculation”, “Expected Result is 15” +”Acutal is “+result
End If
what is the use of function GetROProperty()?
GetROProperty is used to retrieve properties listed in Object Spy.
Example: hWnd=Browser(“browser_name”).GetROProperty(“hwnd”)
Window(“hwnd:=” & hWnd).Minimize
how to store .gui files and dat files in quality center
what is the script for connecting to ORCAL through QUICK TEST PROFESSIONAL PLZ REPLAY TO MY MAIL
AND YOUR WORK IS NICE FOR ALL TESTING PERSONS
Dim objOutlookMsg
Set objOutlook = CreateObject(”Outlook.Application”)
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
objOutlookMsg.To = “anamika.sharma@telus.com”
objOutlookMsg.Subject = “test”
objOutlookMsg.Body = “Hello Anamika, from QTP”
objOutlookMsg.Attachments.Add “C:\Documents and Settings\Desktop\anurag.xls”
objOutlookMsg.Send
This code is not working when i paste this into expert view in QTP. Please send me more guidance.
[...] Query Forum [...]
Pingback by QTP Scripts examples « KR Testing Solutions | February 5, 2008 |
hi sir,
thanks for u r material.please send me quality centre study material.
I have 4 different values and i need to identify a row in an excel using QTP.
i.e Suppose a = ab, b = v4.3, c= WT and d = kl
now these values are present in an excel sheet.
i want the row in which these value are residing.
All the 4 values will be residing in a single row.
Please suggest.
Hi ,
Iam working in testing and I have learned QTP and practicing the scripts now .I want to know the script for the Data driver testing for flight application in windows.
Could you please provide me the script for this …..
Thanks
Krishna
Hey Guys,
You are doing a great job. Please put some more sample script so that new people who are not so familiar with the scripting can learn how to write script. You can write scripts on any scanario and put it on this blog. Thanks for quick response. Are you guys from Delhi?
Nice Kuldeep. Its a very healthy feeling to see the awsome contribution you have done to the industry with me as the 1st one on the list.
Thanq Kuldeep u people are doing a great job
How to verify fontsize using winrunner.
How to verify fontsize using winrunner.
Pls Reply To jack.sekar@gmail.com
Thanks in Advance.
Ravi.J
Hi guys plz let me know any site from where i can download sample applications and practice. As i’m new to Automation by working on a sample application i think i can learn more.
I am planning to perform a Load testing for one of the application. Could you please share with me the load testing plan/ template.
Thanks
Sudheer
91 9941332907
hi,
thank you for the answer posted for me .. it was gr8 and use ful.
one more samll query here whts the reguler expression to find an value “in between”, i know how to use stars with ends with but i could not find an reguler expression to find the value whic is inbetween a word EG: if i type “ple” it should show all the values which has ale in it {sample,ample}, so how do we do this.?
Regards
Masha
need to know how to use silk test tool for automation. I would appreciate if you could also give me some sample test cases for HL7 used for drug Prescription and Pharmacy claims
Thanks
Marina
I am running query using QTP which retrives around 70 to 80 rows from database.This is taking around 3 minutes.But if i run the same query using editors such as Aqua Data Studio it is taking just 40 seconds.
Please any one can tell me ahy it is taking long time to run in QTP as compared to editor.
Is there any solution where i can reduce the query running time in QTP.
Hi,
How to verify the navigation which changes dynamically.
e.g.
Now with 50 Recoreds –Page 1
later with 150 records — page 1 2 3
How to put conditions for available page links at a instant
hi,
The microsoft query button in the data driver wizard is disabled when i am using winrunner. Could u please tell me the reason how to rectify that.
thanks
v
hi,i want to do HP-QTP 9.2 certification.Plz specify how I can get material for preperation.
Is it possible to get QTP result in Excel sheet and in the form of Graph i.e Pie or bar Graph if so pls send script to the above mail id
hi,i completed my B.sc(computer science)in 2004.now i want to learn testing&i want to do job.pls tell me where can i start.
hello sir..
the amazing knowledge shared by you. its awesome and will definately help begginers like me. I hope I’ll definaltey get some help from you on my way to learning QTP descriptive .
Hi,
How to validate or fetch the Data From PDF ? please help me with the same.
Regards
Mahendra
sir
thanks for providing notes on qtp using vb script . hope it benifit many like me.
Hello KR Team,
First of all, Many thanks for you support and effort.
How can i unzip files using VBscript in QTP?
Please help.
Regards
Hi,
I am getting an error while exporting 3XL sheets to the same work book where the data will be written in a loop. From the first loop it writes one row in all the 3Xl sheet, by the end of 4th loop the data sheet is ready to export, but i get “General Run Error” after the first sheet is exported. Please do let me know if there is a way out for the same.
Thanks
Mahendra
Hi ,
how to get the count of number of nodes in a Tree View through VBscript . ie. i want the number of total Parent nodes and child nodes for each nodes and their values for example id Tree View is Register editor i.e when we go to regedit , wee find Left Tree View the their values in that case how can i get the no of parent and Child nodes and also their values
I am using data sheet in excel format and my script opens this excel and fetches values to each and every test case, now i am integrating QC with QTP. Can you please let me know how to open the same data sheet from QC? or else do i need to attach this data sheet to main folder of this feature so that all test cases can access the data sheet?
Plz suggest..
Hi,
This is regarding changing a value in JavaList object that already has some value. Note:This object allows to both select from the lsit or enter a new value.
JavaList(“Quantity (mm):”) already has 100 as its value.
When the following statement runs,the new value from datatable is appending to the old value.Ex:The JavaList(“Quantity (mm):”) already has 100 and im selecting 200 from datatable the result is 100200.Is there a way to to delete the existing value 100.
JavaWindow(“CompanyName – QA.*”).JavaDialog(“Change Order”).JavaList(“Quantity (mm):”).Select DataTable(“NewQuantity”, dtLocalSheet)
Thanks
Sunil
Hello..u hav done a great job by posting so much informations..AL de wishes 4 ur KR testing Solutions..
excellent material
What is automation testing
Software Test Automation is the process of automating the steps of manual test cases using an automation tool Or utility to shorten the testing life cycle with respect to time…
When application undergoes regression, some of the steps might be missed out or skipped which can be avoided in Automation…
Automation helps to avoid human errors and also expedite the testing process…
To implement the Test Automation detailed planning and effort is required
Hi Kuldeep/Rakesh,
You are really doing nice work.I have one query On QTP testing in Oracle Application.
I am trying to do some setups,using QTP and for that purpose,I need to parameterize checkbox.Can you please explain,how I can achive it.
Thanks,
K.Manish.
how to call a url from QTP by scripts?
my scranrio is
Registe a customer in portal
1 After entering the customer code in the portal
2 Will receive a mail with passcode
3 Then entering the passcode in portal to continue further
How to kill the process in the task manager by using vbscrip.
Try this:
strComputer = “.”
Set objWMIService = GetObject(“winmgmts:” _
& “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2″)
Set colProcessList = objWMIService.ExecQuery _
(“SELECT * FROM Win32_Process WHERE Name = ””)
For Each objProcess in colProcessList
objProcess.Terminate()
Next
Hello kuldeep,
Thanks a lot for your response. But i am unable to execute to it.
Regards,
Chaitanya.
hallo,
ich habe versehentlich einige wichtige bilder von meinem MP3 Player gelöscht. Leider sind die Dateien nicht mehr im meinem Papierkorb.
Die Files waren sehr wichtig für mich! Ich würde die gerne wiederherstellen.
Im Internet fand ich dazu die Seite http://www.datenrettung-info.com, die eigentlich schon ganz gut die Möglichkeiten der Wiederherstellung von Daten beschreibt. Dort sind die verschiedenen Wege für unterschiedliche Medien ganz gut beschrieben.
Hat wer noch einen Tipp für mich, wo ich noch weitere Infos finden kann?
danke