Monday, August 6, 2012

What is Web Event Configuration in QTP

QTP has an option to configure Web Event Configuration.
By default, QTP records all click events.
We can configure other events like onmouserover, onfocus, onchange etc...
If we configure all other events for an object the script is not readable. So we need to configure as per our needs.
The changes will be incorporated after changing the settings. Previous generated scripts dont have any impact.

To configure web events navigate to Tools -> Web Event Configuration.
Here we can choose levels/settings required for recording events.



One of the example here is
User has to enter some value in a textbox, then the button beside it will be activated. For this, there is a back end even "onmouseup". So to click on that button, we need to fire that event like below:

B().P().WE().fireevent "onmouseup"
B().P().WB().click



Using web event configuration, we can configure only the web&HTML Objects. For other objects, we need to update the environment specific XML Configuration files.

What are the difference between Delete and Truncate in Sql Server

Following are few differences.

1.
Truncate is a DDL Command.
Delete is a DML Command.


2.
Truncate operation cannot be rolled back.
Delete operation can be rolled back.

3.
By using Truncate operation, it deletes everything and reconstructs the table structure (schema). We can’t retain the values.
By using Delete we can retain the deleted values.

4.
We cannot use where clause in truncate.
Where clause can be used with Delete.

5.
By using Truncate operation, all the identities will be deleted.
By using Delete identities cannot be deleted.

6.

The syntax for truncating a table is:
            truncate table tablename

The syntax for deleting rows from a table is:
      delete from table or
 delete from table where condition

7. 
Truncate table is faster and uses fewer system and transaction log resources than Delete.
The Delete statement removes rows one at a time and records an entry in the transaction log for each deleted row.

8.
Because Truncate table is not logged, it cannot activate a trigger.
It can activate a trigger.