Identify Biggest number in given numbers

‘ Here is the code to identify Biggest no. in given 10 digits

‘ Identify Biggest no. in a given list

‘******************************Called Function with an Array**********************

Function Biggest(a)

val2=a(9)
print val2
Big=val2

For i=0 to ubound(a)

val1=a(i)
print val1

If (val1>Big) Then

Big=val1

else

Big=biggest

End If

biggest=big

Next

‘print “Biggest no. is ………………….”&Big

End Function

‘*******************************End of Function **********************************

Dim a

a=array(1,2,4,3,56,2,35,30,12,5) ‘ Assigning values to an Array “a”

‘************************************ Calling Function ****************************

big=Biggest(a) ‘Function calling with an array “a”

print “Biggest No. is “&big ‘ Printing Returned Value of Function

Thanks & Regards
Baba Fakruddin.D

March 23, 2009 at 2:16 pm Leave a comment

Reverse the Given Number

‘Reversing the Given Number…

Function Reverse(Num)

num_len=len(Num)

for i=0 to len(Num)-1

Rem=Num mod 10

‘msgbox Rem

Num=Num\10

‘msgbox Num

val=val&Rem

print val

Next

Reverse=val

End Function

Num=Inputbox(“Enter a Number to reverse”)

result=Reverse(Num)

msgbox “Reversed Number is      :”&result

thanks & regards,

Baba Fakruddin.D

March 23, 2009 at 2:06 pm Leave a comment

ActionTemplate

If you wanna create ActionTemplate, so follow below steps.

 

Step 1: open a Text document & give the required test script header contents as given below

 ‘**************************************************************

‘PROJECT NAME                                       :

‘CURRENT VERSION                                :

‘SCRIPT NAME                                           :  

‘DESCRIPTION                                           :  

‘PRE – CONDITIONS                                :

‘INPUT DATA SHEET/FILE                      :

‘FEATURES TO BE TESTED                      :

‘REUSABLE ACTIONS USED                   :                             

‘REUSABLE FUNCTIONS USED             :

 ‘CREATED DATE                                        :

‘AUTHOR/TEAM                                       :

‘’*************************************************************

‘REVIEW HISTORY                                    :

‘’*************************************************************

‘REVIEWED BY                                           :

‘REVIEWED ON                                          :

‘LAST MODIFIED DATE                           :        

‘’*************************************************************

Step 2: Save the file as “ActionTemplate.mst” & choose “All files” under “Save As Type” dropdown list in the “Dat” folder as given in below path.

          C:\Program Files\Mercury Interactive\QTP\Dat

 

Now onwards whenever we create “new test” in qtp then automatically/implicitly the above test script header will added to the test script.

thanks & regards,

Baba Fakruddin.D

March 21, 2009 at 7:26 am Leave a comment

ChildObjects

ChildObjects:Returns the collection of child objects contained within the object.

ChildObjects returns similar type of objects which matches with the properties given in Description of Object… under the parent object

e.g. on google.com,
‘systemutil.Run “www.google.com”
clas=inputbox(“Enter your object class”,”Object Class”,”Link”)msgbox clas

Dim obj
Set obj=description.Create
obj(“micclass”).value=clas
set co=browser(“Google”).Page(“Google”).ChildObjects(obj)
msgbox co.count
For i=0 to co.count-1 If (clas=”Link”) Then val=co(i).getroproperty(“text”) print val End If
If (clas=”WebEdit”) Then val=co(i).getroproperty(“html tag”) attext=co(i).getroproperty(“attached text”) print attext print val End If
If (clas=”WebButton”) Then val=co(i).getroproperty(“name”) print val End If
If (clas=”WebRadioGroup”) Then val=co(i).getroproperty(“all items”) print val End IfNext

Thanks & Regards
Baba Fakruddin.D

March 21, 2009 at 7:16 am Leave a comment

Function Returns multiple values? Check it out

Hello friends… this is the question oftenly asked in Interviews…

Returning a multiple values with function….

Function calc(a,b,c,d) ‘ Called Function —– Function Definition

msgbox “a is value “&a ‘ a value passed from calling function
msgbox “b is value “&b ‘ b value passed from calling function

c=a+b ‘ Calculation of c
d=a-b ‘ Calculation of d

calc=array(c,d) ‘ Assigning Calculated values in array of Function name (calc here)

End Function

res=calc(10,20,c,d) ‘Calling Function with Passing input parameters
msgbox res(0) ‘ returning a value from array of Function (calc here)

‘ User Inputs for Addition and Subtraction calculations and getting mutiple values by using Functions
Function calc(a,b,c,d)

msgbox “Value of a is “&a
msgbox “Value of b is “&b

c=cint(a)+cint(b)
d=cint(a)-cint(b)

calc=array(c,d)

End Function

a=inputbox(“Enter a value:”,”a Value”,10)
b=inputbox(“Enter b value:”,”b Value”,20)

result=calc(a,b,c,d)

msgbox ” No. of Values in an Array is ” &ubound(result)+1

iter=ubound(result)

For i= 0 to iter

msgbox “Returned Value of “&i+1&”th iteration is    “&result(i),3,”Returned Value of Function”

Next

Thanks & Regards
Baba Fakruddin.D

March 20, 2009 at 4:58 am Leave a comment

Testing Process in QTP

Hello,

Automation Life cycle in QTP would be like this

1. Preparing for record/generate script

2. Recording/Generating the script

3. Enhancing the script

4. Debugging the Script

5. Executing the script

6. Analyzing the Results

7. Reporting the Defects

Brief description about each phase

1. Preparing to record: Preparing/making ready QTP to record or to generate script, means gathering pre-requisites before developing the test.

(a) Check QTP is available

(b) Check Test Cases are available

(c) Check respective Add-In is installed in QTP

(d) Check application is available or not (if you are using Object Repository)

if above prerequisites are available, you can develop the test in QTP. if your application under development, you should use Descriptive Programming to develop the script.

2. Recording/Generating Script: Now, you can develop the script in QTP or Record Test in QTP. because we have all requirements to develop the script. we make ready QTP in previous step itself.

3. Enhancing the Script: Adding the Steps manually in Test or any function calls, Action calls, if any Loops for no.of iterations, Check Points, Output values, Accessing XML Files, Loading Environment values, Executing any applications or opening web applications, Creating Variable Objects, Creating instances, using Utility Objects, etc., these all should done manually according to our requirements.

4. Debugging: Executing the Script in an user desired fashion called debugging. to find the values of variables and changing the values of variables, checking the flow of script, checking the step in, step out, step over for function calls and action calls, We can pause the test where ever we want and check the forward steps one by one. debugging the iterations for loops like For Next, For Each Next, While, Do Until…etc., these all can be analyze by using the Debugging.

Debug viewer Pane: It is used for viewing the values of variables and changing the values of variables in this contain Watch expressions, Variables, Command Tabs

Watch Expressions: It is used to check the particular variable value and also to change the value of that variable

Variables: It is used to watch all the variable values up to previous step.

Command Tab: It is used to change the variable values in a Test

** If we assign a value to variable in debug viewer pane before assigning the value to that  variable in Script would be overwritten by latest expression.(It may be in Script or in Debug Viewer Pane)

the assigned values automatically updated in Variable Tab and Watch expression tabs

5. Executing the Test: After completion of Debugging, we can go for execution of the Test. Executing test will not stop till the end of Test.It pauses if any error occurs or any unpredictable error occurs,

Some times we have no. of iterations of loops or no. of function/action calls, Data Driven Testing.. pausing the values from different sources to Test to perform parametrization/retesting/regression testing. here, before executing the test keep one or two iterations for loops, one or two values from external source and debug. if we feels that all iterations and data is getting from source are perfect, we can keep all iterations for loops and database sources then execute the Tests. It makes your work efficient, effective and optimized way.

6. Analyzing the Results: After Test Execution, QTP will show you the results in Results Pane. here, we will get how many test cases are failed and how many test cases are passed, Check point validations, Reporter events, Run Time Data Table, some times the results can be sent to run time data table. etc.,

7. Reporting the Defects: If we found any defects in Results Pane, we have to report the defects to Test Lead or if we have Defect Tracking tool, we will report those defects in Defect Tracking Tool and also we can keep the details about that like defect found by, identified on, assigned by, assigned to, status, etc.,

if QC is available, we can send the results directly to QC. because we have option in QTP and also in Results pane to connect with QC.

Please comment on my posts…

Thanks & Regards

Baba Fakruddin.D

March 19, 2009 at 6:33 am Leave a comment

Hello world!

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

March 17, 2009 at 3:31 am 1 comment


August 2016
M T W T F S S
« Mar    
1234567
891011121314
15161718192021
22232425262728
293031  

Recent Posts

Top Clicks

  • None

Pages

Blog Stats

  • 751 hits

Archives


Follow

Get every new post delivered to your Inbox.