Set WshShell = CreateObject("WScript.Shell")
wait(1)
Browser("info").Page("info").WebEdit("uname").Set "Ramu"
wait(1)
Browser("info").Page("info").WebEdit("uname").FireEvent "onfocus"
WshShell.Sendkeys "^a"
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| << < | > >> | |||||
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | 31 | ||
Despite of hundreds of web articles on Smoke and sanity testing, many people still have confusion between these terms and keep on asking to me. Here is a simple and understandable difference that can clear your confusion between smoke testing and sanity testing.
Here are the differences you can see:
SMOKE TESTING:
SANITY TESTING:
Hope these points will help you to clearly understand the Smoke and sanity tests and will help to remove any confusion.
Use the below code to compare Two Excel files data
Keep the below code in .vbs file and just double click on the .vbs.
provide path of the excel files with extension .xls
you can run the below script both in .vbs as well as in QTP Script
---------------------------------------------------------------------
ExcelFilePath1 = InputBox("Please Enter the Path of first Excel File")
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FileExists(ExcelFilePath1) = false )Then
msgbox ExcelFilePath1 & " doesn't exist."
wait(2)
wscript.quit
End If
ExcelFilePath2 = InputBox("Please Enter the Path of second Excel File")
If (fso.FileExists(ExcelFilePath2) = false )Then
msgbox ExcelFilePath2 & " doesn't exist."
wscript.quit
End If
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = false
Set objWorkbook1 = objExcel.Workbooks.Open(ExcelFilePath1)
Set objWorkbook2 = objExcel.Workbooks.Open(ExcelFilePath2)
Set objWorksheet1= objWorkbook1.Worksheets(1)
Set objWorksheet2= objWorkbook2.Worksheets(1)
For Each cell In objWorksheet1.UsedRange
If cell.Value <> objWorksheet2.Range(cell.Address).Value Then
'Highlights in green color if any changes in cells (for the first file)
cell.Interior.ColorIndex = 4
'Highlights the same cell in the Second file
objWorksheet2.range(cell.Address).interior.colorIndex = 4
Else
cell.Interior.ColorIndex = 0
End If
Next
ObjExcel.displayAlerts = False
objExcel.Save
objExcel.quit
set objExcel=nothing
msgbox "It is Done"
Let me know if any you get error while trying to execute the same
We can capture the StatusText of the Browser with the following script
msgbox Browser("title:=Gmail").Object.StatusText
Reporter Object is used for sending information to the test results. With the help of this object you can:
There are some very important methods and properties associated with it.
I think this is a very common method used with Reporter object. I am sure even if you have worked on QTP for a relatively short period, you would have come across this.
Its syntax:
Reporter.ReportEvent EventStatus, ReportStepName, Details
where EventStatus can be:
0 or micPass: If this step runs test passes which is shown in test report.
1 or micFail: If this step runs test fails which is shown in test report.
2 or micDone: Used to send message to the test report and does not affect status of test.
3 or micWarning: Again, used to send warning message to the test report and does not affect status of test.
and
ReportStepName is name of step
and
Details are the user defined details for the given step.
For Example:
Reporter.ReportEvent micPass, "Login Authorization", "The user-defined step passed."
There can be situations where you don't want the full status displayed on the test report. This property can be used to selectively filter the status of your tests.
Its syntax:
Reporter.Filter = NewMode
where NewMode can be:
0 or rfEnableAll: This is the default mode. All reported events are displayed in the Test Results.
1 or rfEnableErrorsAndWarnings: Only those events with a warning or fail status are displayed in the Test Results.
2 or rfEnableErrorsOnly: Only those events with a fail status are displayed in the Test Results.
3 or rfDisableAll: All events in the Test Results are disabled.
This is used to get the path in which current test results are stored.
Its syntax:
Path_of_Results = Reporter.ReportPath
This is used to get the current status of the run session
Its syntax:
Reporter.RunStatus
For Example:
if Reporter.RunStatus = 0 then flag=1;
2008-11-20 @ 12:41:11 pm
by venugopal
there are many problems we will ...
2008-07-16 @ 03:58:49 pm
by Ramu
what r the challenges have faced ...
2008-07-15 @ 10:57:24 am
by veerachary
attached the answers of the above ...
2008-07-10 @ 04:38:52 pm
by Ramu
Can you please provide the answers ...
2008-07-10 @ 04:07:58 pm
by chakri