Write a function which returns the addition of two numbers.
give the value of the numbers outside the function.

Answers were Sorted based on User's Feedback



Write a function which returns the addition of two numbers. give the value of the numbers outside t..

Answer / sandeepguttikonda

PLEASE REFER THIS ANSWER.
Sorry Missed few Lines in the above posted answer. Please
refer this.

1) Write the below code in notepad and save it as .vbs file.

Function Code:
Public Function Addition_Of_Two_Numbers (Value1,Value2)

Result = Value1 + value2
Addition_Of_Two_Numbers = Result
End Function

2) Open Quick Test Professional Functional Testing Tool

3) Go to File-> Settings-> Resources-> Click '+' symbol
under Associated Function Libraries: and upload the abouve
saved file.

4) Go to Expert View.

5) Write this VBScript Code:
Sum_Of_Two_Numbers = Addition_OF_Two_Number(3,4)
Msgbox "The Addition Of Two Numbers
= "&Sum_Of_Two_Numbers

6) Save this Action and run(F5) it.

This will display the answer 7 in a messagebox.

Note: You can change the constants 3,4 as you required.
Example: if we want to know the sum of 13 and 1 we
will get the answer as 14.

Please let me know if you need any further info.

Thanks.

Regards,
Sandeep Guttikonda

Is This Answer Correct ?    16 Yes 4 No

Write a function which returns the addition of two numbers. give the value of the numbers outside t..

Answer / sandeep guttikonda

1) Write the below code in notepad and save it as .vbs file.

Function Code:
Public Function Addition_Of_Two_Numbers (Value1,Value2)

Result = Value1 + value2
Addition_Of_Two_Numbers = Result
End Function

2) Open Quick Test Professional Functional Testing Tool

3) Go to File-> Settings-> Resources-> Click '+' symbol
under Associated Function Libraries: and upload the abouve
saved file.

4) Go to Expert View.

5) Write this VBScript Code:
Sum_Of_Two_Numbers = Addition_OF_Two_Number(3,4)
Msgbox "The Addition Of Two Numbers
= "&Sum_Of_Two_Numbers

This will display the answer 7 in a messagebox.

Note: You can change the constants 3,4 as you required.

Please let me know if you need any further info.

Thanks.

Regards,
Sandeep Guttikonda

Is This Answer Correct ?    12 Yes 4 No

Write a function which returns the addition of two numbers. give the value of the numbers outside t..

Answer / kshama

Thanks a lot Sandeep.........
its really helpful..

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More QTP Interview Questions

What is Automation frame work.How we will prepare in real time.

9 Answers   AppLabs,


What should we say if interviewer asks "What is ur project architecture?".......Can any one help me with clear information.?????????

0 Answers   Infotech,


What are the Features & Benefits of Quick Test Pro ?

0 Answers   Crea,


how can i add an action(external action) programmatically?

3 Answers   Ordain Solutions,


suppose there r 10 action in a test i want to execute action 5 to 10 how would i do that

2 Answers  






How do you script a nested loop in QTP? I am showing a snipet of my code. Any suggestions to help me get this to work would be great appreciated! STEP A - Customer Number: No loop - ISBN: Loop STEP B - Customer Number: Loop - ISBN: Nested Loop Here is the code I am using now. I am using i for the loop and j for the nested loop in STEP B of my script. =========================================== 'CREATE AN ADDITIONAL CUSTOMER Dim myNum, RowNum, RowCnt2, val2, total, i DataTable.ImportSheet "C:\QOE Data - UAT1.xls" ,"Data" ,"Global" RowCnt2 = DataTable.GetRowCount i = 1 DataTable.SetCurrentRow(i) ' Set row to one Do while Not i > RowCnt2 i=i+1 DataTable.SetNextRow MsgBox Datatable.Value("Customer_Num") Msgbox i Msgbox RowCnt2 If Not i > RowCnt2 then val2=datatable.Value("Customer_Num","Global") OracleFormWindow("Sales Order").SelectMenu "File->New" OracleFormWindow("Sales Order").OracleTabbedRegion("Order Information").OracleTextField("Customer Number").SetFocus OracleFormWindow("Sales Order").OracleTabbedRegion("Order Information").OracleTextField("Customer Number").Enter val2 End If 'CREATE SECOND ISBN LIST DataTable.ImportSheet "C:\QOE Data - UAT1.xls" ,"Data" ,"Global" Dim j, RowCnt3, val3 RowCnt3 = DataTable.GetRowCount For j = 1 To RowCnt3 DataTable.SetCurrentRow(i) ' datatable.getSheet("DataTable").setNextRow If Trim(DataTable("ISBN",dtGlobalSheet)) = "" Then j = j - 1 Exit For End If Next 'Define ISBN rows If RowCnt3 <> j Then RowCnt3 = j End If 'Loop through ISBN rows For j = 1 To RowCnt3 DataTable.SetCurrentRow(i) val3 = Datatable.Value("ISBN","Global") msgbox j If j = 1 Then OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item").SetFocus OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item").Enter val3 else If j < 16 Then OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_"&i).SetFocus OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_"&i).Enter val3 else If RowCnt1 => 16 Then OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_15").SetFocus OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_15").InvokeSoftkey "DOWN" OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_15").SetFocus OracleFormWindow("Sales Order").OracleTabbedRegion("Line Items").OracleTextField("Ordered Item_15").Enter val3 end if end if End If Next 'EXIT APP msgbox i loop Browser("Browser").Page("Oracle Applications 11i").Sync Browser("Browser").Close ========================================== It isn't working correctly in my nested loop in STEP B (for ISBN). Any ideas?? Thanks! SBsteve

0 Answers  


what is smart identification?

7 Answers  


what is the difference between seat and concerent licenses.

3 Answers   AppLabs, TCS,


what is Business Process Testing plz explain?

7 Answers   iFlex,


Which line will be executed 1-B(DP).P(OR.link(DP) 2-B(OR).P(Or).Link(DP)

2 Answers   Broadridge,


1.How recognize QTP Dyanamic Image? (suppose tha wedpage contains 3 logos..1 square 2.circle 3.rectangel)there changing at same position how to capture that)

3 Answers   Synechron,


Explain qtp(quick test professional)?

0 Answers  


Categories