What is the difference between property and method?

Answer Posted / amarendra kothuru

Property is nothing like a variable and Method is like a
function.

You cannot pass parameters to a property and you can
directly assign value to it.

for a Method, set of lines of code and when it is called
that executes set of lines written in it and generates the
results. you can pass parameters to the method and you can
retirve the result from the method. You cannot directly
assign any value to it but you can pass it by
Parameterizing it.

Ex: Reporter.Filter - Here Filter is a property
Reporter.ReportEvent - Here ReoprtEvent is a mothod.

Reporter.Filter = 0 'this enable the results for the test
results. Here you can directly assig value to it
Reporter.ReportEvent micPass, "Msg1","Msg2". Here we are
passing three parameters to the methos ReportEvent that
send the results to Test Results.

Reporter is either a prepdefined Abstract class/interface
in QTP that has so many Properties and Moethods

Is This Answer Correct ?    31 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is ODC and GDC?

7361


if there is a web table of having row and colmns.a button is placed at 2nd row's 3rd column which is worked for both edit and delete..how to write script for the button to test both operation on the web table using desriptive programing.. plz help me on script wheather using getroproperty Q2)what is the command for taking valiue from a web table in qtp

23955


What is a Patch in QTP?

615


Does QTP run in any environment?

616


What are the differences between qtp and winrunner?

541






If the weblist is identified as webelement,and by clicking on webelement if the values are displayed,and if the values the values also identified as webelement.then how to fetch the values through script?

4703


what is clean sweep?

1526


how to find that tools work well with ur existing system?

1366


How many types of actions are there in quicktest professional (qtp)?

546


write the vb script for call to new action in qtp?

1869


hi, FOR 3+ QTP INTERVIEW, FOR EXAMPLE WE PUT ONLINE BANKING SYSTEM PROJECT IN OUR RESUME, IN PROJECT MANAGER ROUND...WHAT R THE MAJOR QUESTIONS ARE ASKED IN P.M? PLS TELL ME ATLEAST 10 QUESTIONS?.....AND IF POSSIBLE POST ANSWERS ALSO....

2443


Please guide me release notes of Automation once scripts are completed

1472


How QA specialist can identify when programmatic descriptions are useful?

1978


Can any one tell me how to write a script for selecting open option in File menu of A word document.here you have to add objects to OR.try like that and give me the ans.i asked this question to so many but no one knows.if any one know the answer plz let me know

1414


I have many listboxes in my application. I have to check whether the contents inside the listboxes are in sorted order or not..can anyone please send the code as early as possible

1465