Dim WshShell
Dim WshNetwork
Set WshShell = CreateObject( "WScript.Shell" )
Set WshNetwork = CreateObject( "WScript.Network" )
dummy_user = WshNetwork.UserName
WshShell.Popup dummy_user, 10, "User Name"
Set WshShell = Nothing
Set WshNetwork = Nothing
Showing posts with label QTP. Show all posts
Showing posts with label QTP. Show all posts
Saturday, October 13, 2012
QTP - wscript - How to run DOS commans using windows shell script?
Dim WshShell
Set WshShell = CreateObject( "WScript.Shell" )
WshShell.Run "cmd /K CD C:\&Dir"
Set WshShell = Nothing
Set WshShell = CreateObject( "WScript.Shell" )
WshShell.Run "cmd /K CD C:\&Dir"
Set WshShell = Nothing
QTP - WScript - Launch PopUp that closes after some time
Dim WshShell
Set WshShell = CreateObject( "WScript.Shell" )
WshShell.Popup "This is a popup that closes after 10 seconds.", 10, "MsgBox with Timer"
Set WshShell = Nothing
Set WshShell = CreateObject( "WScript.Shell" )
WshShell.Popup "This is a popup that closes after 10 seconds.", 10, "MsgBox with Timer"
Set WshShell = Nothing
Tuesday, October 9, 2012
QTP - Result Customization
QTP default report provides a lot of information (most of the time too much for the pure audience who are not involve in scripting - BA, Audit, etc). Hence, in many case, test automation developer will be requested to customize it for better readability.
While researching, I came across this post and I must take note on it, it wasn't wildly shared so I assume not many are aware.
URL reference: http://qtp.blogspot.sg/2009/01/qtp-test-run-results.html
The results of each QuickTest run session are saved in a single .xml file (called results.xml).
You can take the test result information from the .xml file and use XSL to display the information you require in a customized format (either when printing from within the QuickTest Test Results window, when displaying test results in your own customized result viewer, or when exporting the test results to an HTML file).
XSL provides you with the tools to describe exactly which test result information to display and exactly where and how to display, print or export it.
You may find it easier to modify the existing .xsl or .css files provided with QuickTest, instead of creating your own customized files from scratch. The files are located in \dat, and are named as follows:
- PShort.xsl - Specifies the content of the test results report printed, or exported to an HTML file, when you select the Short option in the Print or Export to HTML File dialog boxes.
- PDetails.xsl - Specifies the content of the test results report printed, or exported to an HTML file, when you select the Detailed option in the Print or Export to HTML File dialog boxes.
- PSelection.xsl - Specifies the content of the test results report printed, or exported to an HTML file, when you select the Selection option in the Print or Export to HTML File dialog boxes.
- PResults.css - Specifies the appearance of the test results print preview. This file is referenced by all three .xsl files.
Tuesday, September 11, 2012
What to take note with QTP - Recovery Scenario?
Recovery Scenario (RS) is a function used to instruct QTP to recover from unexpected events and errors that occur in your AUT during run-time.
However, please keep in mind that this doesn't mean that RS will be triggered everytime. It is wise to know the behaviour of this function to utilize it better:
Reference URL: http://knowledgeinbox.com/articles/qtp/recovery-scenario/why-is-my-recovery-scenario-not-getting-fired/
However, please keep in mind that this doesn't mean that RS will be triggered everytime. It is wise to know the behaviour of this function to utilize it better:
- RS will not be fired if it is a script error.
Errors here stands for errors which are not involving any Test Object, these are mostly known as syntax error. All the code lines below will raise an error but will not trigger a RS.
X = 2/0
Y = Left("Test", -2)
- RS will not be fired if the Object is not in Object Repository (OR).
If you try to access an object from the OR and it does not exist in the OR at all, then QTP will throw an error and RS won't be fired. Object not found in object repository is treated as a script error by QTP.
- RS will not be fired if it encounter Modal dialog blocking execution.
In situation where your script causes a modal dialog to appear, RS can't get fired in such situations. Below is a sample of modal dialog code line:
Msgbox "You can't fire a Recovery scenario now"
This message box blocks the execution in current thread and QTP get busy waiting for someone to close the message box. In such situation, no RS will be executed.
- RS will not be fired if the required associated library is not found.
One of the operation type in Recovery Operation for RS is Function Call, if the function or the library file is not found for this Function Call, the RS will not get triggered.
- RS will not be fired if the Activate Recovery Scenario setting is not configured properly.
Ensure the configuration is setup properly. Go to File > Settings... > Recovery (Tab) > Activate Recovery Scenario option. If the value is set to 'Never' no RS can get fired, in case value is set to 'On Error' then the recovery scenario will only be fired when an error occurs. In case the scenario is not fired change the setting to 'On Every Step' to try.
- RS will not be fired if it is associated at run-time.
AOM is powerful as it helps us to setup our QTP test programmatically which save a lot of effort when there is a batch of scripts to be updated. However, if RS is associated only during run-time, it won't be fired.
Reference URL: http://knowledgeinbox.com/articles/qtp/recovery-scenario/why-is-my-recovery-scenario-not-getting-fired/
Subscribe to:
Posts (Atom)