Lots of efforts need to spend before Software Test Automation is started. One needs to ensure:
- Stability of product/application – If new features are being introduced and there is a possibility of the existing functionality being disturbed, more effort is required for automation due to rework (Script Fixing)
- Interface to be tested has been identified
- Scope of automation has been identified
- Individual test cases to be automated have been identified & are complete
- Standard Coding definitions for objects is adhered to
- Right tool has been identified
1. Can I change the Active Screen page which is shown on every new test?
This page can be changed to be any valid HTML page. The page can be located either locally or on the network.
For example, if you want your entire organization to view the same Active Screen page when they open QTP, you should open the NewTest.inf file located under the dat\snapshots directory of QTP and set the next line:
FileName1=<any full path to an HTML file>
FileName1=\\mercury\public\MainPage.html
2. How to create an action template?
You can create a template action script that will be used on every new action that is created. You can use this, for example, to add a header comments to each action.
To create the template action you should create a text file with the name ActionTemplate.mst and place it under QTP dat folder.
3. How to pass parameters when calling actions?
You can pass information between actions in several ways:
1. Using the new Action Parameters feature in Quick Test 8.0
2. Putting the variable in the data table and then accessing this data table from the called action.
3. Defining the variable as an environment variable that can be accessed from the entire test.
4. How to configure the report to show only error (by default)?
You can configure the report to show only error by default by adding the following section to the QTReport.ini file (located under QTP bin directory).
[FilterDialog]
ReportAppDefaultFilter=1 # for error only
ReportAppDefaultFilter=3 # shows all messages (default)
5. How to use Environment variable?
QuickTest supports using environment variables. Environment variables can be either system variables or user defined variables.
You can define the user defined variables in an external file which will be read by QuickTest when it will be launched.
6. Does QuickTest have any debugging capabilities?
In order to debug tests you must install the Microsoft Script Debugger. If you did not download and installed it while installing QuickTest, the debugger can be still downloaded from the Microsoft Script Technologies site. After downloading it, double-click on the self-extracting executable and follow the instructions on your screen.
Once the Script Debugger is installed, an arrow points to the current step that is being executed in the Tree View and the Expert View. You can then use the debugger to view local action variables, use the command window, view the objects properties, and more.
More information can be found in the QuickTest User’s Guide.
7. What command-line arguments can I use when launching QuickTest?
Please refer to the QuickTest Command Line utility for more information on how to run QuickTest using a command line.
8. I have a Microsoft Access database that contains data I would like to use in my test. How do I do this?
The powerful ‘Expert View’ allows you to access databases using ADO and ODBC. Below is a sample test that uses the information contained in the Authors table of a database to search for books written by the author.
Dim MyDB
Dim MyEng
Set MyEng = CreateObject(“DAO.DBEngine.35″)
Dim Td
Dim rs
‘ Specify the database to use
Set MyDB = MyEng.OpenDatabase(“BIBLIO.MDB”)
‘ Read and use the name of the first 10 authors
Set Td = MyDB.TableDefs(“Authors”)
Set rs = Td.OpenRecordset
rs.MoveFirst
For i = 1 To 10
Browser(“Book Club”).Page(“Search Books”).WebEdit(“Author Name”).Set rs(“Author”)
Browser(“Book Club”).Page(“Search Books”).WebButton(“Search”).Click
Next
9. How do I add a manual wait step to my test?
A manual wait (think time) can be added to a QuickTest test using the following command:
Call Wait(<time in seconds to wait>)
10. How do I make the test prompt the user for input while it is running?
The VBScript InputBox function allows you to display a dialog box that prompts the user for input and then continue running the test. You can use the value that was entered by the user later on in the test. See the VBScript reference manual for more information on the InputBox function.
The following example shows the InputBox function used to prompt the user for the password.
Browser(“Mercury Tours”).Page(“Mercury Tours”).WebEdit(“username”).Set “administrator”
Passwd = inputbox (“Enter password”, “User Input”)
Browser(“Mercury Tours”).Page(“Mercury Tours”).WebEdit(“password”).Set Passwd
0 comments:
Post a Comment