What is the difference between property and method?
Answers were Sorted based on User's Feedback
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 |
Answer / ravi
Properties are a useful way of expressing a feature of an object, allowing get/set in a common way that can be used by APIs like data-binding, reflection and serialization. So for simple values of the object, properties are handy. Properties can't take arguments, should not have significant side-effects*, and should return quickly and repeatably. Also, there is no such thing as an "extension property" (to mirror an extension method) nor a generic property.
(*=lazy loading etc isn't uncommon, however)
Methods (C# doesn't have functions) are better for expressing things that either change the state, or which have an expectation of taking some time and not necessarily being reproducible. They don't tend to work in binding / serialization etc.
Note that properties are actually just a special way of writing methods. There is little functional difference. It is all about expressing intent. The one thing you don't want to expose, however, is fields (the actualintEmployeeAge instance variable).
| Is This Answer Correct ? | 2 Yes | 2 No |
HOW AUTOMATE TEST SCRIPT ? what time it will do? after gneration of basic script or Any , Plz explain detailed?
can any one tell me what is syntax error in line msgexist=Browser("title:=Gmail: Email.*").Page( "title:=Gmail: Email .*").WebElement(innertext=&msg).exist 'code ************** Call login("lal="," " ) wait(5) Call errormsg("Invalid email address. [?]" ) Function errormsg(msg) msgexist=Browser("title:=Gmail: Email.*").Page( "title:=Gmail: Email .*").WebElement(innertext=&msg).exist if msgexist then Reporter.ReportEvent micPass,"enter valid username or pwd ",msg else Reporter.ReportEvent micFail, "entered valid uname and pwd",msg end if End Function
what is Business Process Testing plz explain?
what is check point?
How we can we create a Text checkpoint in QTP 9.1,Actually what i did is first i put in recording mode and gofor Inser menu>Checkpoint>Textcheckpoint>click,Now an hand symbol came and i showed it to some textbox and cliked but the QTP9.1 is giving an error message like "The Obkect you are selecting doesn't support this operation" If i go for Help of QTP 9.1 information I didn't get any solution,pls help me in this issue.
If an application name is changes frequently i.e while recording it has name "Window1" and then while running its "Windows2" in this case how does QTP handles?
Is text area check point supports for web applications?
what is test scheduling?
What is the advantage of associating a procedure with a test object?
How to get align property of the link on web page?
Hi, i have a string like "INDIA". I need to display this string vertically in Msgbox?
How can you handle exceptions in qtp?