Wednesday, May 27, 2009

General Tips

1. How to put focus on a particular Object?

Window(" Window Name"). winEdit("EditBox Name"). Object.focus

2. Can we merge two or more lines lenght of text into one variable?

Myvar="first line of text"&_
" Second Line of Text"&_
" third Line of Text"&_
" 4th Line of Text"&_
----
----
" Nth Line of text"

msgbox Myvar

Output:- "first line of text Second Line of Text third Line of Text 4th Line of Text ---- ----Nth Line of text"

3. How to capture check Point Result Or Run Action Result?
For check Point:-
CheckPointRunResult=Browser("BrowserName").Page("Page name").WebButton("Name").Check (CheckPoint("Checkpoint Name"))
Msbgox CheckPointRunResult

For Run Action:-
strRunActionResult=RunAction ("ActionName", oneIteration)

4. How to send mail from QC?

Set QCconn = QCUtil.TDConnection
QCconn.SendMail ToList,From,Subject,Body,"", "html"

5. How to Reboot a windows system with QTP code ?

Plese find the code in below Link. http://haripotter.wordpress.com/2008/08/06/how-to-reboot-a-windows-system-using-wmi/

6. how to change default synchronization timeout value with code?

Default Timeout (Test Settings for Object):- Sets or retrieves the delay for finding objects. DefaultTimeOut is a per-test setting

Setting("DefaultTimeout") = 24000 ' Milliseconds

Maximum time in milliseconds to wait before it is determined that an object cannot be found.

Page Load time:-Sets or retrieves the setting for the add to load time option. DefaultLoadTime is a global testing setting. Changes to this setting will be maintained for the remainder of the current testing session.

Setting("DefaultLoadTime") = seconds

'Indicates the time to add, in seconds, to the load time during recording. This option is a safeguard that prevents the test from failing in the event that the amount of time it takes for a page to load during the run session is higher than the amount of time it took during the record session.

Screenshot:- Determines when QuickTest captures and saves images of the application during the test run to display them in the test results.

Setting("SnapshotReportMode") = CaptureValue

' Indicates when the images are captured. The value can be one of the following:
0 - always captures images.
1 - captures images only if an error occurs on the page.
2 - captures images if an error or warning occurs on the page.
3 - never captures images.
Default = 1.

Web Timeout:- Sets or retrieves the delay for navigating to a URL address. WebTimeOut is a per-test setting.

Setting("WebTimeout") = Seconds ' Maximum time in seconds to wait before it is determined that a URL address cannot be found.

WEbPackage :- Configures how to run mouse operations—using browser events or using the mouse. ReplayType is a global testing setting.

Setting.WebPackage("ReplayType") = Setting

Indicates how mouse operations should be run. The value can be one of the following:
1 - Runs mouse operations using browser events.
2 - Runs mouse operations using the mouse.

No comments:

Post a Comment