'************************************************************************************************************************
'Description:
'
'This example opens a test and loads all the add-ins associated with the test.
'
'Assumptions:
'There is no unsaved test currently open in QuickTest.
'For more information, see the example for the Test.SaveAs method.
'************************************************************************************************************************
Dim qtApp 'As QuickTest.Application ' Declare the Application object variable
Dim blnNeedChangeAddins ' Declare a flag for indicating whether the test's associated add-ins are currently loaded
Dim arrTestAddins ' Declare the variable for storing the test's associated add-ins
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
arrTestAddins = qtApp.GetAssociatedAddinsForTest("C:\Tests\Test1") ' Create an array containing the list of addins associated with this test
' Check if all required add-ins are all already loaded
blnNeedChangeAddins = False ' Assume no change is necessary
For Each testAddin In arrTestAddins ' Iterate over the test's associated add-ins list
If qtApp.Addins(testAddin).Status <> "Active" Then ' If an associated add-in is not loaded
blnNeedChangeAddins = True ' Indicate that a change in the loaded add-ins is necessary
Exit For ' Exit the loop
End If
Next
If qtApp.Launched And blnNeedChangeAddins Then
qtApp.Quit ' If a change is necessary, exit QuickTest to modify the loaded add-ins
End If
If blnNeedChangeAddins Then
Dim blnActivateOK
blnActivateOK = qtApp.SetActiveAddins(arrTestAddins, errorDescription) ' Load the add-ins associated with the test and check whether they load successfully.
If Not blnActivateOK Then ' If a problem occurs while loading the add-ins
MsgBox errorDescription ' Show a message containing the error
WScript.Quit ' And end the automation program.
End If
End If
If Not qtApp.Launched Then ' If QuickTest is not yet open
qtApp.Launch ' Start QuickTest (with the correct add-ins loaded)
End If
qtApp.Visible = True ' Make the QuickTest application visible
qtApp.Open "C:\Tests\Test1" ' Open the test
Set qtApp = Nothing ' Release the Application object
Monday, December 21, 2009
Installation Testing Requirements for Client Software
1.Check the required disk space.
2.verify registry changes.
3.Veriy IIS.
4.Verify services.
5.break the installation process in between.
6.Rollback to previous version.
7.test for uninstallation.
8.installation over the network, online installation, patch installation.
9.Database checking on Installation.
10.Shared DLL installation and uninstallation etc.
11.Files or Folders copied.
2.verify registry changes.
3.Veriy IIS.
4.Verify services.
5.break the installation process in between.
6.Rollback to previous version.
7.test for uninstallation.
8.installation over the network, online installation, patch installation.
9.Database checking on Installation.
10.Shared DLL installation and uninstallation etc.
11.Files or Folders copied.
Thursday, October 29, 2009
Csharp programs compilation
1)
###############start:Compiling a program:start#####################################
csc C:\Gopi\DotNetPgms\HelloWorld.cs
################End:Compiling a library program:End#######################################
2)
###############start:Compiling a library program:start#####################################
csc /target:library /out:MathLibrary.DLL C:\Gopi\DotNetPgms\Add.cs C:\Gopi\DotNetPgms\Mult.cs
################End:Compiling a library program:End#######################################
3)
#################start:Compiling a program which has a dll reference:start###################################
csc /out:TestCode.exe /reference:MathLibrary.DLL C:\Gopi\DotNetPgms\TestCode.cs
################End:Compiling a nunit program:End#######################################
4)
#################start:Compiling a nunitprogram:start###################################
first generate the required dll
csc /target:library /out:bank.DLL C:\Gopi\DotNetPgms\bank.cs
write a nunit code.
add a reference(dll) of actual code,add reference of nunit.framework.dll and add nunit code
csc /target:library /out:accountbank.DLL /reference:nunit.framework.dll,bank.DLL C:\Gopi\DotNetPgms\Arithmetica.cs
################End:Compiling a nunit program:End#######################################
###############start:Compiling a program:start#####################################
csc C:\Gopi\DotNetPgms\HelloWorld.cs
################End:Compiling a library program:End#######################################
2)
###############start:Compiling a library program:start#####################################
csc /target:library /out:MathLibrary.DLL C:\Gopi\DotNetPgms\Add.cs C:\Gopi\DotNetPgms\Mult.cs
################End:Compiling a library program:End#######################################
3)
#################start:Compiling a program which has a dll reference:start###################################
csc /out:TestCode.exe /reference:MathLibrary.DLL C:\Gopi\DotNetPgms\TestCode.cs
################End:Compiling a nunit program:End#######################################
4)
#################start:Compiling a nunitprogram:start###################################
first generate the required dll
csc /target:library /out:bank.DLL C:\Gopi\DotNetPgms\bank.cs
write a nunit code.
add a reference(dll) of actual code,add reference of nunit.framework.dll and add nunit code
csc /target:library /out:accountbank.DLL /reference:nunit.framework.dll,bank.DLL C:\Gopi\DotNetPgms\Arithmetica.cs
################End:Compiling a nunit program:End#######################################
Friday, September 4, 2009
automate the Windows in .Net?
Microsoft Active Accessibility is not a comprehensive solution to automate the Windows UI. There are certain limitations. E.g., using accessibility, we can search for a TextBox control on MS Word Ribbon, but we can not get or set a value in it, which can be done using Microsoft UIA. So, a combination of MSAA and UIA can provide a more promising solution for Windows UI automation.
Random Number Generation within given Range?
Function genRand(upperbound,lowerbound)
msgbox Int((upperbound - lowerbound + 1) * Rnd + lowerbound)
End Function
call genRand(10,1)
msgbox Int((upperbound - lowerbound + 1) * Rnd + lowerbound)
End Function
call genRand(10,1)
Monday, August 17, 2009
Quality Assurance vs Quality Control ?
QC Vs QA
QC : QA
Product : Process
Reactive : Proactive
Line function : Staff function
Find defects : Prevent defects
QC Vs QA - Examples
QC : QA
Walkthrough : Quality Audit
Testing : Defining Process
Inspection : Selection of tools
Checkpoint review : Training
QC : QA
Product : Process
Reactive : Proactive
Line function : Staff function
Find defects : Prevent defects
QC Vs QA - Examples
QC : QA
Walkthrough : Quality Audit
Testing : Defining Process
Inspection : Selection of tools
Checkpoint review : Training
What is Security Testing ?
* Test by pasting internal url directly into browser address bar without login. Internal pages should not open.
* If you are logged in using username and password and browsing internal pages then try changing url options directly. I.e. If you are checking some publisher site statistics with publisher site ID= 123. Try directly changing the url site ID parameter to different site ID which is not related to logged in user. Access should denied for this user to view others stats.
* Try some invalid inputs in input fields like login username, password, input text boxes. Check the system reaction on all invalid inputs.
* Web directories or files should not be accessible directly unless given download option.
* Test the CAPTCHA for automates scripts logins.
* Test if SSL is used for security measures. If used proper message should get displayed when user switch from non-secure http:// pages to secure https:// pages and vice versa.
* All transactions, error messages, security breach attempts should get logged in log files somewhere on web server.
* Authorization Testing
* Authentication Testing
* If you are logged in using username and password and browsing internal pages then try changing url options directly. I.e. If you are checking some publisher site statistics with publisher site ID= 123. Try directly changing the url site ID parameter to different site ID which is not related to logged in user. Access should denied for this user to view others stats.
* Try some invalid inputs in input fields like login username, password, input text boxes. Check the system reaction on all invalid inputs.
* Web directories or files should not be accessible directly unless given download option.
* Test the CAPTCHA for automates scripts logins.
* Test if SSL is used for security measures. If used proper message should get displayed when user switch from non-secure http:// pages to secure https:// pages and vice versa.
* All transactions, error messages, security breach attempts should get logged in log files somewhere on web server.
* Authorization Testing
* Authentication Testing
Friday, August 14, 2009
Sorting the sheets in an Excel file using VB of QTP?
Sub Sort_Sheets()
Dim Sort_Mode_Descending As Boolean
Dim No_of_Sheets As Integer
Dim Outer_Loop As Integer
Dim Inner_Loop As Integer
No_of_Sheets = Sheets.Count
'Change Flag As appropriate
Sort_Mode_Descending = False
For Outer_Loop = 1 To No_of_Sheets
For Inner_Loop = 1 To Outer_Loop
If Sort_Mode_Descending = True Then
If UCase(Sheets(Outer_Loop).Name) > UCase(Sheets(Inner_Loop).Name) Then
Sheets(Outer_Loop).Move Before:=Sheets(Inner_Loop)
End If
End If
If Sort_Mode_Descending = False Then
If UCase(Sheets(Outer_Loop).Name) < UCase(Sheets(Inner_Loop).Name) Then
Sheets(Outer_Loop).Move Before:=Sheets(Inner_Loop)
End If
End If
Next Inner_Loop
Next Outer_Loop
End Sub
Moving to a particular cell in the sheet:
Application.Goto ActiveSheet.Range("A54")
Dim Sort_Mode_Descending As Boolean
Dim No_of_Sheets As Integer
Dim Outer_Loop As Integer
Dim Inner_Loop As Integer
No_of_Sheets = Sheets.Count
'Change Flag As appropriate
Sort_Mode_Descending = False
For Outer_Loop = 1 To No_of_Sheets
For Inner_Loop = 1 To Outer_Loop
If Sort_Mode_Descending = True Then
If UCase(Sheets(Outer_Loop).Name) > UCase(Sheets(Inner_Loop).Name) Then
Sheets(Outer_Loop).Move Before:=Sheets(Inner_Loop)
End If
End If
If Sort_Mode_Descending = False Then
If UCase(Sheets(Outer_Loop).Name) < UCase(Sheets(Inner_Loop).Name) Then
Sheets(Outer_Loop).Move Before:=Sheets(Inner_Loop)
End If
End If
Next Inner_Loop
Next Outer_Loop
End Sub
Moving to a particular cell in the sheet:
Application.Goto ActiveSheet.Range("A54")
Trunc Function Oracle/PLSQL?
Oracle/PLSQL: Trunc Function (with dates)
In Oracle/PLSQL, the trunc function returns a date truncated to a specific unit of measure.
The syntax for the trunc function is:
trunc ( date, [ format ] )
date is the date to truncate.
format is the unit of measure to apply for truncating. If the format parameter is omitted, the trunc function will truncate the date to the day value, so that any hours, minutes, or seconds will be truncated off.
Below are the valid format parameters:
Unit Valid format parameters
Year SYYYY, YYYY, YEAR, SYEAR, YYY, YY, Y
ISO Year IYYY, IY, I
Quarter Q
Month MONTH, MON, MM, RM
Week WW
IW IW
W W
Day DDD, DD, J
Start day of the week DAY, DY, D
Hour HH, HH12, HH24
Minute MI
Applies To:
* Oracle 8i, Oracle 9i, Oracle 10g, Oracle 11g
For example:
trunc(to_date('22-AUG-03'), 'YEAR') would return '01-JAN-03'
trunc(to_date('22-AUG-03'), 'Q') would return '01-JUL-03'
trunc(to_date('22-AUG-03'), 'MONTH') would return '01-AUG-03'
trunc(to_date('22-AUG-03'), 'DDD') would return '22-AUG-03'
trunc(to_date('22-AUG-03'), 'DAY') would return '17-AUG-03'
In Oracle/PLSQL, the trunc function returns a date truncated to a specific unit of measure.
The syntax for the trunc function is:
trunc ( date, [ format ] )
date is the date to truncate.
format is the unit of measure to apply for truncating. If the format parameter is omitted, the trunc function will truncate the date to the day value, so that any hours, minutes, or seconds will be truncated off.
Below are the valid format parameters:
Unit Valid format parameters
Year SYYYY, YYYY, YEAR, SYEAR, YYY, YY, Y
ISO Year IYYY, IY, I
Quarter Q
Month MONTH, MON, MM, RM
Week WW
IW IW
W W
Day DDD, DD, J
Start day of the week DAY, DY, D
Hour HH, HH12, HH24
Minute MI
Applies To:
* Oracle 8i, Oracle 9i, Oracle 10g, Oracle 11g
For example:
trunc(to_date('22-AUG-03'), 'YEAR') would return '01-JAN-03'
trunc(to_date('22-AUG-03'), 'Q') would return '01-JUL-03'
trunc(to_date('22-AUG-03'), 'MONTH') would return '01-AUG-03'
trunc(to_date('22-AUG-03'), 'DDD') would return '22-AUG-03'
trunc(to_date('22-AUG-03'), 'DAY') would return '17-AUG-03'
Thursday, August 13, 2009
Triggers in Oracle PL/SQL ?
Oracle/PLSQL Topics: Creating Triggers
Insert Triggers:
BEFORE INSERT Trigger
AFTER INSERT Trigger
Update Triggers:
BEFORE UPDATE Trigger
AFTER UPDATE Trigger
Delete Triggers:
BEFORE DELETE Trigger
AFTER DELETE Trigger
Drop Triggers:
Drop a Trigger
Disable/Enable Triggers:
Disable a Trigger
Disable all Triggers on a table
Enable a Trigger
Enable all Triggers on a table
Oracle/PLSQL: BEFORE INSERT Trigger
A BEFORE INSERT Trigger means that Oracle will fire this trigger before the INSERT operation is executed.
The syntax for an BEFORE INSERT Trigger is:
CREATE or REPLACE TRIGGER trigger_name
BEFORE INSERT
ON table_name
[ FOR EACH ROW ]
DECLARE
-- variable declarations
BEGIN
-- trigger code
EXCEPTION
WHEN ...
-- exception handling
END;
trigger_name is the name of the trigger to create.
Restrictions:
* You can not create a BEFORE trigger on a view.
* You can update the :NEW values.
* You can not update the :OLD values.
For example:
If you had a table created as follows:
CREATE TABLE orders
( order_id number(5),
quantity number(4),
cost_per_item number(6,2),
total_cost number(8,2),
create_date date,
created_by varchar2(10)
);
We could then create a BEFORE INSERT trigger as follows:
CREATE OR REPLACE TRIGGER orders_before_insert
BEFORE INSERT
ON orders
FOR EACH ROW
DECLARE
v_username varchar2(10);
BEGIN
-- Find username of person performing INSERT into table
SELECT user INTO v_username
FROM dual;
-- Update create_date field to current system date
:new.create_date := sysdate;
-- Update created_by field to the username of the person performing the INSERT
:new.created_by := v_username;
END;
Insert Triggers:
BEFORE INSERT Trigger
AFTER INSERT Trigger
Update Triggers:
BEFORE UPDATE Trigger
AFTER UPDATE Trigger
Delete Triggers:
BEFORE DELETE Trigger
AFTER DELETE Trigger
Drop Triggers:
Drop a Trigger
Disable/Enable Triggers:
Disable a Trigger
Disable all Triggers on a table
Enable a Trigger
Enable all Triggers on a table
Oracle/PLSQL: BEFORE INSERT Trigger
A BEFORE INSERT Trigger means that Oracle will fire this trigger before the INSERT operation is executed.
The syntax for an BEFORE INSERT Trigger is:
CREATE or REPLACE TRIGGER trigger_name
BEFORE INSERT
ON table_name
[ FOR EACH ROW ]
DECLARE
-- variable declarations
BEGIN
-- trigger code
EXCEPTION
WHEN ...
-- exception handling
END;
trigger_name is the name of the trigger to create.
Restrictions:
* You can not create a BEFORE trigger on a view.
* You can update the :NEW values.
* You can not update the :OLD values.
For example:
If you had a table created as follows:
CREATE TABLE orders
( order_id number(5),
quantity number(4),
cost_per_item number(6,2),
total_cost number(8,2),
create_date date,
created_by varchar2(10)
);
We could then create a BEFORE INSERT trigger as follows:
CREATE OR REPLACE TRIGGER orders_before_insert
BEFORE INSERT
ON orders
FOR EACH ROW
DECLARE
v_username varchar2(10);
BEGIN
-- Find username of person performing INSERT into table
SELECT user INTO v_username
FROM dual;
-- Update create_date field to current system date
:new.create_date := sysdate;
-- Update created_by field to the username of the person performing the INSERT
:new.created_by := v_username;
END;
Subscribe to:
Posts (Atom)