Subscribe by Email


Showing posts with label Command. Show all posts
Showing posts with label Command. Show all posts

Thursday, September 27, 2012

How would you connect to database using vbscript?


VBScript or visual basic scripting edition is the basic scripting language for the HP test automation suite called the quick test professional. This scripting language is quite a lively script whose interpretation is done via script host of the Microsoft windows. This scripting language comes with a whole lot of excellent and powerful functions with good support for data types, error handling and variables. 

There are two engines that can interpret the VBScript namely:
  1. Wscript.exe and Cscript.exe: it works in the GUI environment f the windows with the help of the WSH or windows script host. However this engine is basically used for automating the administration tasks as well as to automate the systems.
  2. VBScript.dll- this engine can be invoked by asp.dll and basically serves in the web environment.
VBScript is used as the following in quick test professional:
  1. Data base record set object
  2. Data base command object
  3. Data base connection object
Here in this article, it has been discussed about how a connection between data base and quick test professional can be established through the VBScript. 

The below mentioned are the various VBScripts available for connecting and accessing data base in quick test professional:
  1. Updating records in a record set
  2. Deleting a record from the record set
  3. Finding a record in record set
  4. Clearing a data base table
  5. Connecting to an ADO data base
  6. Adding a new record to the data base

How to connect to a database using VBScript?

- To connect to a data base using VBScript, a DSN inventory is required. 
- An ADO connection is another requirement for making an open connection with a specific data source. 
- Once this connection is established, the data base can be easily accessed as well as manipulated. 
- Also, once this connection is established it is not important how many times that data base is accessed. 
- Another way to establish a connection with the data base using VBScript is by passing a connection string through some record set object or a particular command. 
- Though this method is quite quick but it holds good only for the single specific queries. 
- An essential connection from a web server to a data base is nothing but a data source. 
- This connection can either be established via a dedicated machine running SQL server or through a data base file on a web server at some other location. 

Two types of DSNs or data sources are available namely:
  1. File DSN: This is the connection that is created by the script when an access to the data base is required. Here the path and name of the data base to be accessed needs to be specified. Another condition for this DSN to work is that the data base to be connected to must be residing on a server in a directory which must be accessible by the script.
  2. System DSN: Creation of this kind of connection is under the charge of the administrator of the web server which consists of the required data base. This is the most popular data base connection since it is much reliable than its former counterpart.
- After the access to the data base is complete it is important that the connection should be closed at the end of each page. 
- For creating any application, the foremost thing that is required is data base itself. 
- A number of programs are available for developing a data base, however, the Microsoft access remains the most popular of them all. 
- It is important for web application designer to know the basics of the data base usage with VBScript as well as active server pages for developing real web applications.


Sunday, August 19, 2012

What are different types of running a test in WinRunner?


After you are done with the creation of the test scripts for your cases, you subject them to be compiled by the winrunner which in turn interprets these test scripts line by line. Ultimately, the tests are executed as though they were being run by a real world human user. 

In this article we are going to discuss about different types of running a test in winrunner. 

1. Running a test to check the software system or application:  
This type of test run involves a rigorous check of the behavior of the software   system or application as well as a sincere comparison among the current results and the expected results. The folder where you want the verification results to be saved can be specified by you itself. Following steps are followed for this type of test run:
a)   For opening your test hog down to open option in the file menu and click it to open a test.
b)   But be first make it sure that you have set the run mode to verify run mode on the test tool bar.
c)   Now choose an appropriate test menu command or you simply click on one of the run options. When you do this a run test dialogue box appears.
d)   It is your wish if you want to save your test results with a default test run name.
e)   The winrunner saves the test results.

    2. Running a test for debugging a test script: 
   Whenever you have to debug the test scripts a similar type of comparison is carried out by the winrunner as in the previous type between the current response and the expected response. After debugging only one set of debug results is saved in the debug results folder. So whenever you carry out a second execution of the same test, the results are over written by the winrunner. Following steps can be carried out for this type of test run:
    a)   Follow the same step a in the previous test run type to open a test.
    b)   Then go for the debug option from the list of run modes on the test tool bar.
    c)   Then you go for the run or debug menu command that you want.
    d)   For executing the entire test go for the “run from top” option available in the test menu.

    3. Running a test for updating the expected result: 
    This type of test run helps one in updating the expected results. In this case, the expected results that were created earlier are replaced by the new results and these new results in turn become the subject of comparison for the subsequent test results to come. For running a test for updating the expected results follow the first step as given in the previous two cases for opening a test. Go to the list of run modes from the test tool bar and select the update option. Then choose an appropriate test menu command from the list. For updating the entire set go for the option “run from top” in the test tool bar or simply click on the “from top” button on the tool bar.

    4. Running a test for checking the date operations: 
   Once a test has been created that checks date operations, it is run to check in what way the software system or application responds to the date information present in the test. You must make sure that in the general category of the options dialogue box the option “enable date operations” must have been selected. 


Facebook activity