The Test Object (TO) property and Runtime Object (RO) property must have confused (or might be still confusing) you at some point of time. Here is our attempt to demystify these for you:
- Test objects are the QTP (HP) defined classes that are used to represent the objects in your application under test (AUT). The information about these objects is stored in object repository. Runtime objects are the actual AUT objects in your application which a Test object refers to during the test run. The information about these objects can be accessed using Object Spy.
- Test objects classes defined by HP for a particular environment type can be seen in Object Identification dialog present under Tools > Object Identification in QTP/UFT.
- Test object properties set is created and maintained by QuickTest (HP). Runtime object properties set is created and maintained by the object creator (Microsoft for IE objects, Mozilla Firefox for Firefox objects, the product developer for ActiveX objects, etc.) Test object properties are normally the subset of runtime object properties.
- Test object methods are methods that QuickTest recognizes and records when they are performed on an object while you are recording a test, and that QuickTest performs when your test runs. Runtime object methods are the methods of the object in your application as defined by the object creator(the developer!). You can access and perform runtime object methods using the .Object property.
- .GetTOProperty can be used to fetch a particular test object property from the object repository. .GetROProperty can be used to fetch a particular run time object property from the AUT at run time.
Here is a demonstration of GetTOproperty and GetROProperty on DemoAUT site. We will add the username object in object repository. Run the two lines of code below and try to retrieve the value of “value” property.
msgbox Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").GetTOProperty("value")
Output is blank since there is no property in the object repository with the name value.
msgbox Browser("Welcome: Mercury Tours").Page("Welcome: Mercury Tours").WebEdit("userName").GetROProperty("value")
Output is mercury since QTP has fetched the value of value property at run time from the AUT.
I hope this makes things clear in regards to Test objects, Run Time objects, GetToProperty and GetRoProperty. In case you have any questions, please feel free to ask in the comments section below.
I’ve facing another problem now, where I am unable to extract the innertext/outertext from a WebElement. Though I am able to identify & highlight the WebElement using Object Spy, but when I try extracting its value programmatically, its returning empty string & highlight is also not working.
‘ — My code
Browser(“name:=Cards.*”).Page(“title:=Cards.*”).highlight ‘ —> This works
Browser(“name:=Cards.*”).Page(“title:=Cards.*”).WebElement(“class:=dsk-block”,”html id:=postStatus”).Highlight ‘ —> UFT throws General run error
Msgbox Browser(“name:=Cards.*”).Page(“title:=Cards.*”).WebElement(“class:=dsk-block”,”html id:=postStatus”).GetROProperty(“outertext”) ‘—> Returns blank
Msgbox Browser(“name:=Cards.*”).Page(“title:=Cards.*”).WebElement(“class:=dsk-block”,”html id:=postStatus”).GetROProperty(“innertext”) ‘—> Returns blank
Please let me know, if I am missing something here or you can redirect me to any link for understanding any concept. Will appreciate if you can share any function to retrieve the object values, if you have..
-Thanks in advance,
Vinni!
Hello Sir,
How r you doing..?
There is request of mine that “Smart Identification document’s” language is not easy to understand so please if can modify the document please do it.
Thanks
Sanjeev
@sanjeev: Sure, stay tuned!
Thanks a lot
Automation Testing and QTP has recently taken my fancy and you are doing a great job through this blog.
This will help a lot of beginners like me to master the key concepts of QTP.
Keep up the good work !!
-Anshul
hi ankur,
this is excellent article with dis i get familiarize regdng Objects.
Thanks
Good article!
Keep up the good work.
Hi Ankur,
I have stucked at a web application script. I have something of the form Browser–>Page–>WebTable–>WebTable–>WebTable–>WebElement. This WebElement is not recorded (i dont know why)n so i had to get all the children of the web page one by one till i find my interested one. There are number of WebElement which i am suppose to identify by its innertext alone. There exist a WebElement which has a description of innertext as “Accounting”, unfortunately i have a web link named “Accounting”. Now the only way to differentiate between these 2 childrens of the page is their class name viz: WebElement and WebLink. But nothing is working for me to get the class name. Kindly reply this one too 🙂
Hi Ankur,
Can you give an example to explain it more? I understand the object in application at run time is RO and object that in that used in test is TO. So for same WinEdit Object in Test (TO) may have different property value at runtime (RO). Is this what the main difference?
I’m confused that in what context these exist.
Thanks
Vineet
This is a really good blog i ever seen, U r work is greatly appreciable ankur…
Thanks alot for ur articles….
Hi Ankur,
Article is good and the site is really helpful.
Giving example in these cases would help more.
Thank u
hi Ankur,
Could you please share actual/sample files and scripts involved in Keyword Driven Framework?
Please send me the scripts and files on s.santhok@gmail.com..
The Keyword Driven framework consists of the basic components given below
1. Control File
2. Test Case File
3. Startup Script
4. Driver Script
5. Utility Script
please the files would be of great help to me
thanku
Hi All,
I have started the recording of web application. Can anybody guides me for effective recording. I have little bit knowledge in QTP.
Regards,
Krishan Malik
Please help me by sending the sample files for the below components. and how to use these files in QTP 8.0 and have initial stage
1. Control File
2. Test Case File
3. Startup Script
4. Driver Script
5. Utility Script
Thanks in advance
It would be great if u forward some of the examples to my Email id nandhakumarpalani@yahoo.com
hi ankur
i am a beginner in qtp.i have a problem, when i replay my test qtp flashes meassage that object does not recognised.can u plz giv some tips how to configure objects
Issues in parsing WSDLs using Web Service Addin
Hi Ankur,
Posting in this forum after a long time. I am currently working on QTP 9.2 with Web Services Addin 9.2.
I have encountered an issue of parsing few WSDLs (not all) from a specific Server. I feel something wrong with my Installation. It is working fine in few of the PCs, though configurations of all PCs are same.
We use Concurrent Licensees.
In the new PCs, I am installing QTP and Web Service Addin, I am unable to parse few WSDLs using Web Service Testing Wizard. Few of them are becoming successful in this method too. Other machines, I do not have any problem in parsing WSDLs.
For the cases, where it fails, I get UnSupportedType XML Warehouse.
For instance, while parsing
a) WSDL in new PCs, I get:
‘ AccountService Web service object steps
Set AccountCreate = WebService(“AccountService”).AccountCreate(XMLWarehouse(“UnsupportedType”))
WebService(“AccountService”).Check CheckPoint(“AccountCreate”)
But in other PCs, while parsing the same WSDL, It is becoming successful.
‘ AccountService Web service object steps
Set AccountCreate = WebService(“AccountService”).AccountCreate (XMLWarehouse(“AccountCreateInputMessage”))
WebService(“AccountService”).Check CheckPoint(“AccountCreate “)
b) ) WSDL works fine in both the PCs. Likewise; many other WSDLs work fine in both the PCs.
Just wondering, if you/anyone has overcome this type of scenarios?
Hi Ankur, I am new to this blog. One question for you. My Dev people use third party tools like syncfusion and devexpress and QTP are not able to identify the objects in the application. the existing qtp scripts used the x,z position to identify the objects. Do you have a better idea? this is driving me crazy everytime I run QTP scripts, I need to modify the position. re-record some objects…
very much useful article
keep up the momentum going
Hi Ankur,
Can u suggest through QTP can we recognize that mail was shooting or not on submission of button?
Hi Ankur,
I have one question here.
Can u please tell me, Hw to retrive the column names of the excel sheet into QTP?
Hello Ankur,
can u plz tell me how to compare results in QTP ……..
As activation code/numeric value is generated i need to compare it with my DB ………….
or suppose i need to save the last activation code in my excel sheet …..so that i can manually compare it with the DB
Hi Ankur
How to record & ply back on remote system. Is it work as similar as normal system?
Poorna.
Sandeep,
Thanks, you made the whole explanation easier.
Swetha.
Does The QTP script recorded on Windos XP run properly on Vista Ultimate(vice a versa) else what changes needs to made to work it properly
Is it possible to record the right click events with new QTP 9.5 or with some descriptive programming.
Great Article….Good work Ankur, your articles really helping new comers to gain thorough knowledge about QTP…
Keep it up…
Test Object: Property of a object at the time of recording and programming.
Run object: Property of a object found when QTP Execute script on web objects.
Sandeep Panda
Hi Ankur
Good Stuff, but it will be great help to the readers if you provide examples on To and Ro properties
Thanks
Excellent article ankur………i havn’t seen this information in any of the stuff i have gone through about QTP…….excellent one ….keep it up……..
Hi Ankur,
Had a question. Can I post a HTTP request to my application using QTP ?
Thanks
Ankur You are doing excellant work, it is really helpful for newcommers and persons who are already working in QTP.
Ankur you are doing good job. Its really helpful. Keep posting new solutions.
Really Great Work Ankur, Keep it up . u r helping lot of people with this info
Great Work Done…!!!!!
Shantha
This really nice Ankur!!!
Excellent article!
Keep up the good work.