Sunday, 18 August 2013

More About Triggers

If a trigger is specified within the SQL*Plus shell, the definition must end with a point “.” In the last line. Issuing the command run causes SQL*Plus to compile this trigger definition. A trigger definition can be loaded from a file using the command @. Note that the last line in the file must consist of a slash “/”.
A trigger definition cannot be changed, it can only be re-created using the or replace clause.
The command drop deletes a trigger.
After a trigger definition has been successfully compiled, the trigger automatically is enabled. The command alter trigger disable is used to deactivate a trigger. All triggers defined on a table can be (de)activated using the command
alter table enable | disable all trigger;
The data dictionary stores information about triggers in the table USER TRIGGERS. The information includes the trigger name, type, table, and the code for the PL/SQL block.

Introduction of SetTOProperty in QTP

The SetToProperty is a useful feature when the you do not want to add the multiple objects of same type with differing values. The same can be explained with an example like we have two editboxes in the application and both differ by an assistive proprty. Here we can add only one of them in ObjectRepository and while handling the second one we can use the first Object and define the assistive property at runtime in code. The code could be like as follows
Object(Description).SetTOProperty Property,Value
Lets explore the same with sample application:
Dialog(”ABC”).Activate
Dialog(”ABC “).WinEdit(”First Name:”).set “XYZ”
Dialog(”ABC “).WinEdit(”First Name:”).SetTOProperty “attached text”, “Last Name”
Dialog(”ABC “).WinEdit(”First Name:”).Set “ABC”
Dialog(”Login”).WinButton(”Yes”).Click
Our OR contains only one WinEdit box and that is “First Name” and we have reduced the OR size by defining the only one editbox and adding the second edit box at run time.

Introduction of Java Website Testing

1. JRM Testing:-Java Runtime Environment – if Java is working properly on the desktop, and in each of your browsers. test that Java Web Start is working properly on the desktop, and in each of your browsers. Just because Java/Java Web Start works in one browser, does not mean it will automatically work in another.
For this:-
1.Configure your set environment for the CLASSPATH.
For ex:- cd \MyDir
javac.exe -classpath . HelloWorld.java
2. Copy your various library jars into the C:\Program Files\java\jre6\lib\ext directory
3. then we have to set it using a script.
4. In Internet Explorer, go into Tools -> Internet option -> Advanced -> Java(Sun). Make sure
Sun Java is checked
5. Internet Explorer, make sure all three boxes under Tools ->Internet option -> Advanced ->
Microsoft VM are checked.
6. In Internet Explorer, make sure all three boxes under Tools -> Internet option -> Advanced ->
Microsoft VM are checked.
7. In Internet Explorer 7+, you must OK allow blocked content permission to run Active X on the
site
8. Test your JRE on the desktop by typing in a DOS box: java.exe –version
9. Test Java Web Start on the desktop by typing javaws.exe
10. we can use these things though http://www.javatester.org/

How to Restart the PC Using QTP

Dim OpSysSet
Set OpSysSet = GetObject(”winmgmts:{(Shutdown)}//./root/cimv2″).ExecQuery(”select * from
Win32_OperatingSystem where Primary=true”)
for each OpSys in OpSysSet
OpSys.Reboot()
HWND – HWND is a lowlevel pointer to the memory loacation from where the definition of any object in memory starts. HWND is used to access those objects.

How to Use Dos Commands from QuickTest Script

QuickTest does this by using standard VBScript you can simply use the Windows Scripting
Host Shell object.
‘For Example:
Dim oShell
Set oShell = CreateObject (”WSCript.shell”)
‘The following VBScript code opens a command window, changes to the path to C:\ , and executes the DIR command.
oShell.run “cmd /K CD C:\ & Dir”
Set oShell = Nothing